Skip to content

Commit 50abf8f

Browse files
committed
修改创建和更新时间的类型
1 parent 6c8cf32 commit 50abf8f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

migrations/2022_07_04_154626_create_users_table.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ public function up(): void
3232
$table->string('avatar', 256)->default('')->comment('头像');
3333
$table->unsignedTinyInteger('status')->default(1)->comment('状态');
3434
$table->unsignedTinyInteger('enable')->default(1)->comment('是否可用');
35-
$table->timestamps();
35+
$table->dateTime('created_at')->default('2022-01-01')->comment('创建时间');
36+
$table->dateTime('updated_at')->default('2022-01-01')->comment('更新时间');
3637

3738
$table->unique(['userid'], 'UNIQUE_USERID');
3839
$table->comment('用户表');

migrations/2022_07_05_152728_create_departments_table.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ public function up(): void
2424
$table->unsignedInteger('id', false)->primary();
2525
$table->string('name', 64)->default('')->comment('部门名称');
2626
$table->unsignedInteger('parent_id')->default(0)->comment('父级部门ID');
27-
$table->timestamps();
27+
$table->dateTime('created_at')->default('2022-01-01')->comment('创建时间');
28+
$table->dateTime('updated_at')->default('2022-01-01')->comment('更新时间');
2829

2930
$table->index(['parent_id'], 'INDEX_PARENT_ID');
3031
$table->comment('部门表');

0 commit comments

Comments
 (0)