20220122021108_create_full_send_ban_goods_table.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. use think\migration\Migrator;
  3. use think\migration\db\Column;
  4. class CreateFullSendBanGoodsTable extends Migrator
  5. {
  6. /**
  7. * 满就送禁用商品
  8. * Change Method.
  9. *
  10. * Write your reversible migrations using this method.
  11. *
  12. * More information on writing migrations is available here:
  13. * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
  14. *
  15. * The following commands can be used in this method and Phinx will
  16. * automatically reverse them when rolling back:
  17. *
  18. * createTable
  19. * renameTable
  20. * addColumn
  21. * renameColumn
  22. * addIndex
  23. * addForeignKey
  24. *
  25. * Remember to call "create()" or "update()" and NOT "save()" when working
  26. * with the Table class.
  27. */
  28. public function change()
  29. {
  30. $this->table('full_send_goods', array('id' => true, 'primary_key' => ['id'], 'engine' => 'InnoDB', 'comment' => '满就送商品表'))
  31. ->addColumn('full_send_activity_id', 'integer', array('limit' => 11, 'signed' => false, 'default' => 0, 'comment' => '满就送活动ID'))
  32. ->addColumn('goods_id', 'integer',array('limit' => 10, 'signed' => false, 'default'=> 0,'comment'=>'商品ID'))
  33. ->addColumn('is_except', 'integer',array('limit' => 4, 'signed' => false, 'default'=> 0,'comment'=>'设置可用商品或禁用商品0:可用,1:禁用'))
  34. ->addColumn('create_time', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '创建时间'))
  35. ->addColumn('update_time', 'integer', array('limit' => 10,'signed' => false, 'default' => 0, 'comment' => '更新时间'))
  36. ->create();
  37. }
  38. }