m220227_143427_common_config_value.php 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. use yii\db\Migration;
  3. class m220227_143427_common_config_value extends Migration
  4. {
  5. public function up()
  6. {
  7. /* 取消外键约束 */
  8. $this->execute('SET foreign_key_checks = 0');
  9. /* 创建表 */
  10. $this->createTable('{{%common_config_value}}', [
  11. 'id' => "int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键'",
  12. 'app_id' => "varchar(20) NOT NULL DEFAULT '' COMMENT '应用'",
  13. 'config_id' => "int(10) NOT NULL DEFAULT '0' COMMENT '配置id'",
  14. 'merchant_id' => "int(10) unsigned NULL DEFAULT '0' COMMENT '商户id'",
  15. 'store_id' => "int(10) unsigned NULL DEFAULT '0' COMMENT '店铺ID'",
  16. 'data' => "text NULL COMMENT '配置内'",
  17. 'PRIMARY KEY (`id`)'
  18. ], "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公用_配置值表'");
  19. /* 索引设置 */
  20. $this->createIndex('config_id','{{%common_config_value}}','config_id',0);
  21. /* 表数据 */
  22. $this->insert('{{%common_config_value}}',['id'=>'1','app_id'=>'backend','config_id'=>'6','merchant_id'=>'0','store_id'=>'0','data'=>'']);
  23. $this->insert('{{%common_config_value}}',['id'=>'2','app_id'=>'backend','config_id'=>'1','merchant_id'=>'0','store_id'=>'0','data'=>'Copyright © 2016-2024 RageFrame All Rights Reserved.']);
  24. $this->insert('{{%common_config_value}}',['id'=>'3','app_id'=>'backend','config_id'=>'60','merchant_id'=>'0','store_id'=>'0','data'=>'']);
  25. $this->insert('{{%common_config_value}}',['id'=>'4','app_id'=>'backend','config_id'=>'59','merchant_id'=>'0','store_id'=>'0','data'=>'']);
  26. $this->insert('{{%common_config_value}}',['id'=>'5','app_id'=>'backend','config_id'=>'4','merchant_id'=>'0','store_id'=>'0','data'=>'']);
  27. $this->insert('{{%common_config_value}}',['id'=>'6','app_id'=>'backend','config_id'=>'2','merchant_id'=>'0','store_id'=>'0','data'=>'RageFrame']);
  28. $this->insert('{{%common_config_value}}',['id'=>'7','app_id'=>'backend','config_id'=>'5','merchant_id'=>'0','store_id'=>'0','data'=>'']);
  29. $this->insert('{{%common_config_value}}',['id'=>'8','app_id'=>'backend','config_id'=>'7','merchant_id'=>'0','store_id'=>'0','data'=>'']);
  30. $this->insert('{{%common_config_value}}',['id'=>'9','app_id'=>'backend','config_id'=>'52','merchant_id'=>'0','store_id'=>'0','data'=>'1']);
  31. $this->insert('{{%common_config_value}}',['id'=>'10','app_id'=>'backend','config_id'=>'55','merchant_id'=>'0','store_id'=>'0','data'=>'1']);
  32. $this->insert('{{%common_config_value}}',['id'=>'11','app_id'=>'backend','config_id'=>'53','merchant_id'=>'0','store_id'=>'0','data'=>'0']);
  33. $this->insert('{{%common_config_value}}',['id'=>'12','app_id'=>'backend','config_id'=>'193','merchant_id'=>'0','store_id'=>'0','data'=>'']);
  34. $this->insert('{{%common_config_value}}',['id'=>'13','app_id'=>'backend','config_id'=>'90','merchant_id'=>'0','store_id'=>'0','data'=>'1']);
  35. $this->insert('{{%common_config_value}}',['id'=>'14','app_id'=>'backend','config_id'=>'64','merchant_id'=>'0','store_id'=>'0','data'=>'1']);
  36. $this->insert('{{%common_config_value}}',['id'=>'15','app_id'=>'backend','config_id'=>'61','merchant_id'=>'0','store_id'=>'0','data'=>'1']);
  37. /* 设置外键约束 */
  38. $this->execute('SET foreign_key_checks = 1;');
  39. }
  40. public function down()
  41. {
  42. $this->execute('SET foreign_key_checks = 0');
  43. /* 删除表 */
  44. $this->dropTable('{{%common_config_value}}');
  45. $this->execute('SET foreign_key_checks = 1;');
  46. }
  47. }
粤ICP备19079148号