diff --git a/database/migrations/2022_05_03_145712_add_times_field_to_magic_table.php b/database/migrations/2022_05_03_145712_add_times_field_to_magic_table.php new file mode 100644 index 00000000..a97f7f23 --- /dev/null +++ b/database/migrations/2022_05_03_145712_add_times_field_to_magic_table.php @@ -0,0 +1,37 @@ +dateTime('created_at')->useCurrent(); + } + if (!Schema::hasColumn('magic', 'updated_at')) { + $table->dateTime('updated_at')->useCurrent()->useCurrentOnUpdate(); + } + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('magic', function (Blueprint $table) { + $table->dropColumn(['created_at', 'updated_at']); + }); + } +};