mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
33 lines
1.0 KiB
PHP
33 lines
1.0 KiB
PHP
<?php
|
|
|
|
use think\migration\Migrator;
|
|
|
|
/**
|
|
* 商品标签数据
|
|
*/
|
|
class ShopGoodsMark extends Migrator
|
|
{
|
|
public function change()
|
|
{
|
|
// 当前操作
|
|
$table = "shop_goods_mark";
|
|
|
|
// 存在则跳过
|
|
if ($this->hasTable($table)) {
|
|
return;
|
|
}
|
|
|
|
// 创建数据表
|
|
$this->table($table, [
|
|
'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-商品-标签',
|
|
])
|
|
->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '标签名称'])
|
|
->addColumn('remark', 'string', ['limit' => 200, 'default' => '', 'comment' => '标签描述'])
|
|
->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重'])
|
|
->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '标签状态(1使用,0禁用)'])
|
|
->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间'])
|
|
->save();
|
|
|
|
}
|
|
}
|