123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- class CreateTalkskillChosenTable extends Migrator
- {
- /**
- * Change Method.
- *
- * Write your reversible migrations using this method.
- *
- * More information on writing migrations is available here:
- * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
- *
- * The following commands can be used in this method and Phinx will
- * automatically reverse them when rolling back:
- *
- * createTable
- * renameTable
- * addColumn
- * renameColumn
- * addIndex
- * addForeignKey
- *
- * Remember to call "create()" or "update()" and NOT "save()" when working
- * with the Table class.
- */
- public function change()
- {
- $table = $this->table('talkskill_chosen')->setComment('精选话术');
- $table->addColumn('title', 'string', ['limit'=> 255, 'comment'=> '标题', 'default'=> ''])
- ->addColumn('use_count', 'integer', ['limit'=> 10, 'comment'=> '使用次数', 'default'=> 0])
- ->addColumn('view_times', 'integer', ['limit'=> 10, 'comment'=> '浏览次数', 'default'=> 0])
- ->addColumn('del', 'integer', ['limit'=> 1, 'comment'=> '上下架,1下架', 'default'=> 0])
- ->addColumn('addtime', 'timestamp', ['comment'=> '添加时间', 'default'=> 'CURRENT_TIMESTAMP'])
- ->addColumn('root_id', 'integer', ['limit'=> 10, 'comment'=> '组织id', 'default'=> 0])
- ->addColumn('employee_id', 'integer', ['limit'=> 10, 'comment'=> '员工id', 'default'=> 0])
- ->addColumn('user_cate', 'string', ['limit'=> 100, 'comment'=> '适用人群', 'default'=> ''])
- ->addColumn('house_type', 'string', ['limit'=> 255, 'comment'=> '房屋类型', 'default'=> ''])
- ->addColumn('cate1', 'string', ['limit'=> 255, 'comment'=> '一级分类', 'default'=> ''])
- ->addColumn('cate2', 'string', ['limit'=> 255, 'comment'=> '二级分类', 'default'=> ''])
- ->create();
- }
- }
|