M230614014107AokalanV3.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace addons\Distribution\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M230614014107AokalanV3
  6. */
  7. class M230614014107AokalanV3 extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $this->execute("CREATE TABLE `qimall_addons_distribution_goods_repurchase` (
  15. `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  16. `mall_id` INT(10) NOT NULL DEFAULT '0' COMMENT '商城ID',
  17. `item_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '商品id',
  18. `status` TINYINT(4) NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
  19. `created_at` INT(10) UNSIGNED NOT NULL DEFAULT '0',
  20. `updated_at` INT(10) UNSIGNED NOT NULL DEFAULT '0',
  21. PRIMARY KEY (`id`) USING BTREE,
  22. INDEX `item_id` (`item_id`) USING BTREE
  23. )
  24. COMMENT='复购等于报单'
  25. COLLATE='utf8mb4_general_ci'
  26. ENGINE=InnoDB;");
  27. }
  28. /**
  29. * {@inheritdoc}
  30. */
  31. public function safeDown()
  32. {
  33. echo "M230614014107AokalanV3 cannot be reverted.\n";
  34. return false;
  35. }
  36. /*
  37. // Use up()/down() to run migration code without a transaction.
  38. public function up()
  39. {
  40. }
  41. public function down()
  42. {
  43. echo "M230614014107AokalanV3 cannot be reverted.\n";
  44. return false;
  45. }
  46. */
  47. }