1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- class CreateWechatActivityTable 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('wechat_activity', ['comment' => '微爆活动'])
- ->addColumn('root_id', 'integer', ['limit' => 11, 'comment' => '所属企业'])
- ->addColumn('title', 'string', ['limit' => 255, 'comment' => '标题'])
- ->addColumn('start_date', 'date', ['comment' => '开始时间'])
- ->addColumn('end_date', 'date', ['comment' => '结束时间'])
- ->addColumn('addtime', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '添加时间'])
- ->addColumn('schedule_jiav_num', 'integer', ['comment' => '赛程加微任务量', 'default' => 0, 'limit'=>5])
- ->addColumn('schedule_meet_num', 'integer', ['comment' => '赛程见面任务量', 'default' => 0, 'limit'=>5])
- ->addColumn('schedule_zd_num', 'integer', ['comment' => '赛程转单任务量', 'default' => 0, 'limit'=>5])
- ->addColumn('schedule_deposit_num', 'boolean', ['comment' => '赛程收定任务量', 'default' => 0, 'limit'=>3])
- ->addColumn('one_jv_integral', 'integer', ['comment' => '添加一个加微多少分', 'default' => 0])
- ->addColumn('one_dd_integral', 'integer', ['comment' => '添加一个到店多少分', 'default' => 0])
- ->addColumn('one_lf_integral', 'integer', ['comment' => '添加一个量房多少分', 'default' => 0])
- ->addColumn('one_qd_integral', 'integer', ['comment' => '添加一个签订多少分', 'default' => 0])
- ->addColumn('one_zd_integral', 'integer', ['comment' => '添加一个转单多少分', 'default' => 0])
- ->addColumn('ticket', 'string', ['limit' => 255, 'comment' => '活动唯一标识'])
- ->addColumn('delete_time', 'integer', ['comment' => '删除时间', 'default' => 0])
- ->create();
- }
- }
|