12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- class CreateZaActivityRelationTable 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('za_activity_relations', array('id' => true, 'primary_key' => ['id'], 'engine' => 'InnoDB', 'comment' => '买一赠一用户关联表'))
- ->addColumn('order_id', 'integer',array('limit' => 11, 'signed' => false, 'default' => 0, 'comment'=>'主订单id,赠送人下单后写入一条记录'))
- ->addColumn('child_order_id', 'integer',array('limit' => 11, 'signed' => false, 'default' => 0, 'comment'=>'赠送订单id,领取后生成'))
- ->addColumn('expire_time', 'datetime',array('null' => true,'comment'=>'过期时间'))
- ->addColumn('receive_state', 'integer',array('limit' => 11, 'signed' => false, 'default' => 0, 'comment'=>'领取状态 0:未领取 1:已领取 2:领取失败'))
- ->addColumn('receive_time', 'datetime',array('null' => true,'comment'=>'领取时间'))
- ->addColumn('receive_user_id', 'integer',array('limit' => 11, 'signed' => false, 'default' => 0, 'comment'=>'领取用户id'))
- ->addColumn('create_time', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '创建时间'))
- ->addColumn('update_time', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '更新时间'))
- ->addColumn('sign_str', 'string',array('limit' => 255, 'default'=> '','comment'=>'加密串,赠送人下单支付后生成'))
- ->save();
- }
- }
|