1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- class CreateAgentArticleTable 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()
- {
- $this->table('agent_article')
- ->addColumn('root_id', 'integer', ['comment'=>'企业'])
- ->addColumn('employee_id', 'integer', ['comment'=>'员工'])
- ->addColumn('title', 'string', ['comment'=>'标题', 'default'=>''])
- ->addColumn('file', 'text', ['comment'=>'封面', 'null'=> true])
- ->addColumn('type', 'string', ['comment'=>'文件类型', 'default'=>''])
- ->addColumn('content', 'text', ['comment'=>'内容', 'null'=> true])
- ->addColumn('talkskill', 'text', ['comment'=>'话术', 'null'=> true])
- ->addColumn('disable', 'integer', ['comment'=>'开启', 'default'=>0])
- ->addColumn('share_num', 'integer', ['comment'=>'分享数量', 'default'=>0])
- ->addColumn('clue_num', 'integer', ['comment'=>'线索数量', 'default'=>0])
- ->addColumn('addtime', 'integer', ['comment'=>'添加时间', 'default'=>0])
- ->addColumn('down_status', 'boolean', ['limit'=>2, 'comment'=>'图片的下载状态', 'default'=>0])
- ->addColumn('file_media_id', 'string', ['limit'=> 1000, 'comment'=> '上传腾讯的图片id数组', 'null'=> true])
- ->create();
- }
- }
|