## 在我的日常工作中對數據庫設計的理解。
**以laravel為例**
```
/**
* 管理員表
*/
Schema::create('admins', function (Blueprint $table) {
$table->comment = '管理員表';
$table->increments('id')->comment('管理員ID');
$table->string('username',50)->unique()->default('')->comment('賬號');
$table->string('password')->default('')->comment('密碼');
$table->integer('group_id')->nullable()->comment('權限組ID');
$table->tinyInteger('status')->default(1)->comment('審核狀態:0=禁用,1=啟用');
$table->rememberToken();
$table->uuid('uuid');
$table->timestamps();
});
```
1.表必須有注釋。
2.表字段必須有注釋。
3.基本所有表必須有添加時間、修改時間、status狀態字段、sort排序字段。
4.如果使用laravel框架必須使用數據遷移、數據填充。
5.表明必須加s(這個是laravel的規范)。