Skip to content

Instantly share code, notes, and snippets.

@yankchina
Last active December 20, 2015 06:49
Show Gist options
  • Save yankchina/6088845 to your computer and use it in GitHub Desktop.
Save yankchina/6088845 to your computer and use it in GitHub Desktop.
yii create table model
$this->createTable('tbl_topic',
array(
'id' =>'pk',
'title' =>'string NOT NULL',
'description' => 'text COMMENT \'说明\'',
'project_id' => 'int(11) DEFAULT NULL',
'owner_id' => 'int(11) DEFAULT NULL',
'status_code' => 'int(11) DEFAULT NULL',
),
'ENGINE=InnoDB DEFAULT CHARSET=utf8');
@yankchina
Copy link
Author

用于创建一个非常简单的mysql表格

@yankchina
Copy link
Author

其构建命令式 yiic migrate create create_sample_table
其植入数据库的命令式 yiic migrate

@yankchina
Copy link
Author

增加 sql 备注的方式

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment