Skip to content

Commit

Permalink
Migration fields with timezones
Browse files Browse the repository at this point in the history
  • Loading branch information
curder committed Nov 16, 2023
1 parent c333ccc commit 18070bb
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion docs/partials/migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`**
例如从 **`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()` 列。

0 comments on commit 18070bb

Please sign in to comment.