M240607074153CreateMPWxPlugins.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240607074153CreateMPWxPlugins
  6. */
  7. class M240607074153CreateMPWxPlugins extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = <<<SQL
  15. CREATE TABLE `qimall_mpwx_plugins` (
  16. `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
  17. `addons_name` varchar(100) NOT NULL DEFAULT '' COMMENT '插件标识',
  18. `name` varchar(100) NOT NULL DEFAULT '' COMMENT '插件名称',
  19. `plugins` varchar(255) NOT NULL DEFAULT '' COMMENT '插件安装配置',
  20. `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态【1启用 0禁用 -1删除】',
  21. `created_at` int(10) unsigned DEFAULT '0' COMMENT '创建时间',
  22. `updated_at` int(10) unsigned DEFAULT '0' COMMENT '修改时间',
  23. PRIMARY KEY (`id`) USING BTREE
  24. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='微信小程序插件表';
  25. SQL;
  26. $this->execute($sql);
  27. }
  28. /**
  29. * {@inheritdoc}
  30. */
  31. public function safeDown()
  32. {
  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 "M240607074153CreateMPWxPlugins cannot be reverted.\n";
  43. return false;
  44. }
  45. */
  46. }