20220721062520_add_mobile_to_member_welfare_table.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. use think\migration\Migrator;
  3. use think\migration\db\Column;
  4. class AddMobileToMemberWelfareTable extends Migrator
  5. {
  6. /**
  7. * Change Method.
  8. *
  9. * Write your reversible migrations using this method.
  10. *
  11. * More information on writing migrations is available here:
  12. * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
  13. *
  14. * The following commands can be used in this method and Phinx will
  15. * automatically reverse them when rolling back:
  16. *
  17. * createTable
  18. * renameTable
  19. * addColumn
  20. * renameColumn
  21. * addIndex
  22. * addForeignKey
  23. *
  24. * Remember to call "create()" or "update()" and NOT "save()" when working
  25. * with the Table class.
  26. */
  27. public function change()
  28. {
  29. $this->table('member_welfare')
  30. ->addColumn('mobile', 'string',array('limit' => 20,'default'=>'','comment'=>'门店电话'))
  31. ->addColumn('deploy_type', 'integer', array('limit' => 10,'signed' => false, 'default' => 1, 'comment' => '配置方式 1导入第三方券码 2自制券码'))
  32. ->addColumn('welfare_name', 'string', array('limit' => 50, 'default' => '', 'comment' => '自制券码名称,内部查看'))
  33. ->addColumn('provider', 'string',array('limit' => 30,'default'=>'','comment'=>'提供方'))
  34. ->save();
  35. $this->table('member_welfare_draw')
  36. ->addColumn('deploy_type', 'integer', array('limit' => 10,'signed' => false, 'default' => 1, 'comment' => '配置方式 1导入第三方券码 2自制券码'))
  37. ->addColumn('check_time', 'datetime', array('null' => true,'comment'=>'核销日期'))
  38. ->save();
  39. }
  40. }