diff --git a/docs/partials/migrations.md b/docs/partials/migrations.md index a30b00d9c..f4ebbbd91 100644 --- a/docs/partials/migrations.md +++ b/docs/partials/migrations.md @@ -6,4 +6,20 @@ 如果想更改数据库迁移的顺序,只需重命名文件的时间戳。 -例如从 **`2018_08_04_070443_create_posts_table.php`** 到 **`2018_07_04_070443_create_posts_table.php`**(从 **`2018_08_04`** 更改为 **`2018_07_04`**) \ No newline at end of file +例如从 **`2018_08_04_070443_create_posts_table.php`** 到 **`2018_07_04_070443_create_posts_table.php`**(从 **`2018_08_04`** 更改为 **`2018_07_04`**) + + +## 具有时区的迁移字段 + +在迁移中不仅有 `timestamps()`,还有用于时区的 `timestampsTz()`。 + +```php +Schema::create('employees', function (Blueprint $table) { + $table->increments('id'); + $table->string('name'); + $table->string('email'); + $table->timestampsTz(); +}); +``` + +此外,还有 `dateTimeTz()`、`timeTz()`、`timestampTz()`、`softDeletesTz()` 列。 \ No newline at end of file