M240417082535CreateTableAgentApply.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace addons\Agent\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240417082535CreateTableAgentApply
  6. */
  7. class M240417082535CreateTableAgentApply extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $createSql = "CREATE TABLE `qimall_addons_agent_apply` (
  15. `id` int(11) NOT NULL AUTO_INCREMENT,
  16. `mall_id` int(11) NOT NULL,
  17. `user_id` int(11) NOT NULL,
  18. `mobile` varchar(45) NOT NULL,
  19. `name` varchar(45) NOT NULL,
  20. `remark` varchar(1000) NOT NULL DEFAULT '' COMMENT '申请备注',
  21. `check_remark` varchar(1000) NOT NULL DEFAULT '' COMMENT '审核备注',
  22. `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
  23. `check_status` tinyint(3) NOT NULL DEFAULT '0' COMMENT '0待审核1审核通过2不通过',
  24. `created_at` int(11) NOT NULL DEFAULT '0',
  25. `updated_at` int(11) NOT NULL DEFAULT '0',
  26. PRIMARY KEY (`id`) USING BTREE,
  27. KEY `idx_mall_user` (`mall_id`,`user_id`) USING BTREE
  28. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='渠道分红审核';";
  29. $this->execute($createSql);
  30. }
  31. /**
  32. * {@inheritdoc}
  33. */
  34. public function safeDown()
  35. {
  36. echo "M240417082535CreateTableAgentApply cannot be reverted.\n";
  37. return false;
  38. }
  39. /*
  40. // Use up()/down() to run migration code without a transaction.
  41. public function up()
  42. {
  43. }
  44. public function down()
  45. {
  46. echo "M240417082535CreateTableAgentApply cannot be reverted.\n";
  47. return false;
  48. }
  49. */
  50. }