M241228013756SecondaryCard.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace addons\SecondaryCard\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M241228013756SecondaryCard
  6. */
  7. class M241228013756SecondaryCard extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql="CREATE TABLE `qimall_addons_reservation_service_store_secondary_card` (
  15. `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  16. `mall_id` int(11) unsigned NOT NULL COMMENT '商城ID',
  17. `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '技师用户ID',
  18. `store_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '门店id',
  19. `secondary_card_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '绑定的次卡ID',
  20. `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态0禁用,-1删除,1正常',
  21. `created_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  22. `updated_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  23. PRIMARY KEY (`id`) USING BTREE,
  24. KEY `user_id` (`user_id`) USING BTREE,
  25. KEY `store_id` (`store_id`) USING BTREE,
  26. KEY `secondary_card_id` (`secondary_card_id`) USING BTREE
  27. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='技师绑定的o2o门店次卡';";
  28. $this->execute($sql);
  29. }
  30. /**
  31. * {@inheritdoc}
  32. */
  33. public function safeDown()
  34. {
  35. echo "M241228013756SecondaryCard cannot be reverted.\n";
  36. return false;
  37. }
  38. /*
  39. // Use up()/down() to run migration code without a transaction.
  40. public function up()
  41. {
  42. }
  43. public function down()
  44. {
  45. echo "M241228013756SecondaryCard cannot be reverted.\n";
  46. return false;
  47. }
  48. */
  49. }