M241120090530createQimallAddonsStoreAssociatedUser.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace addons\Store\console\migrations;
  3. use addons\Store\common\models\StoreAdmin;
  4. use yii\db\Migration;
  5. /**
  6. * Class M241120090530createQimallAddonsStoreAssociatedUser
  7. */
  8. class M241120090530createQimallAddonsStoreAssociatedUser extends Migration
  9. {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function safeUp()
  14. {
  15. $this->execute("CREATE TABLE `qimall_addons_store_associated_user` (
  16. `id` int(11) NOT NULL AUTO_INCREMENT,
  17. `mall_id` int(11) NOT NULL DEFAULT '0' COMMENT '商城ID',
  18. `store_id` int(11) NOT NULL DEFAULT '0' COMMENT '门店id',
  19. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户id',
  20. `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态[0禁用 1启用 -1删除]',
  21. `created_at` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  22. `updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  23. PRIMARY KEY (`id`),
  24. KEY `idx_mall_store_user` (`mall_id`,`store_id`,`user_id`) USING BTREE
  25. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='门店关联会员';");
  26. }
  27. /**
  28. * {@inheritdoc}
  29. */
  30. public function safeDown()
  31. {
  32. echo "M241120090530createQimallAddonsStoreAssociatedUser cannot be reverted.\n";
  33. return false;
  34. }
  35. /*
  36. // Use up()/down() to run migration code without a transaction.
  37. public function up()
  38. {
  39. }
  40. public function down()
  41. {
  42. echo "M241120090530createQimallAddonsStoreAssociatedUser cannot be reverted.\n";
  43. return false;
  44. }
  45. */
  46. }