更新代码
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class CreateArticleCategoryTable extends Migrator
|
||||
{
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('yz_article_category', ['engine' => 'InnoDB', 'collation' => 'utf8mb4_unicode_ci']);
|
||||
$table
|
||||
->addColumn('name', 'string', ['limit' => 50, 'null' => false, 'comment' => '分类名称'])
|
||||
->addColumn('cid', 'integer', ['signed' => true, 'null' => false, 'default' => 0, 'comment' => '父级ID'])
|
||||
->addColumn('image', 'string', ['limit' => 255, 'null' => true, 'comment' => '分类图片'])
|
||||
->addColumn('sort', 'integer', ['signed' => true, 'null' => false, 'default' => 0, 'comment' => '排序'])
|
||||
->addColumn('status', 'integer', ['signed' => true, 'null' => false, 'default' => 1, 'comment' => '状态:1=正常,2=禁用'])
|
||||
->addColumn('create_time', 'integer', ['signed' => true, 'null' => false, 'default' => 0, 'comment' => '创建时间'])
|
||||
->addColumn('update_time', 'integer', ['signed' => true, 'null' => false, 'default' => 0, 'comment' => '更新时间'])
|
||||
->addColumn('delete_time', 'integer', ['signed' => true, 'null' => true, 'comment' => '删除时间'])
|
||||
->addIndex(['cid'], ['name' => 'idx_cid'])
|
||||
->addIndex(['status'], ['name' => 'idx_status'])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user