dggjimai/database/migrations/20190829163727_brand.php

21 lines
863 B
PHP
Executable File

<?php
use think\migration\Migrator;
use think\migration\db\Column;
class Brand extends Migrator
{
public function change()
{
$table = $this->table('brand', ['comment'=>'品牌','engine' => 'InnoDB', 'encoding' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci']);
$table
->addColumn('name', 'string', ['limit' => 50, 'default' => '', 'comment' => '名称'])
->addColumn('img', 'string', ['limit' => 255, 'default' => '', 'comment' => '图片'])
->addColumn('create_time', 'integer', ['limit' => 10, 'default' => 0, 'comment' => '创建时间'])
->addColumn('update_time', 'integer', ['limit' => 10, 'default' => 0, 'comment' => '更新时间'])
->addColumn('delete_time', 'integer', ['limit' => 10, 'default' => 0, 'comment' => '删除时间'])
->create();
}
}