m160719_084110_admin_config.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. use yii\db\Migration;
  3. class m160719_084110_admin_config extends Migration
  4. {
  5. public function up()
  6. {
  7. $sql1 = "
  8. CREATE TABLE IF NOT EXISTS `admin_config` (
  9. `id` int(20) NOT NULL AUTO_INCREMENT,
  10. `label` varchar(150) DEFAULT NULL,
  11. `key` varchar(255) DEFAULT NULL,
  12. `value` varchar(2555) DEFAULT NULL,
  13. `description` varchar(255) DEFAULT NULL,
  14. `created_at` datetime DEFAULT NULL,
  15. `updated_at` datetime DEFAULT NULL,
  16. `created_person` varchar(150) DEFAULT NULL,
  17. PRIMARY KEY (`id`)
  18. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;
  19. ";
  20. $this->execute($sql1);
  21. $sql2 = "
  22. INSERT INTO `admin_config` (`id`, `label`, `key`, `value`, `description`, `created_at`, `updated_at`, `created_person`) VALUES
  23. (6, '品牌统计-订单处理脚本,多少月前', 'brand_order_month_before', '10', '取多少个月前的订单', '2016-04-26 17:53:30', '2016-06-30 11:58:50', 'admin'),
  24. (7, '品牌统计-广告数量最大个数', 'brand_show_count', '22', '品牌统计-广告数量最大个数', '2016-04-28 16:41:13', '2016-07-05 10:01:34', 'admin'),
  25. (8, '废弃-多少月前的数据 - erp_on_way_count_by_day', 'erp_on_way_count_by_day_before_months', '24', '对应erpCollInit脚本 - 处理表:erp_on_way_count_by_day ,增加subtotal字段功能,处理多少个月之前的表数据', '2016-05-24 15:56:39', '2016-06-30 12:01:53', 'admin'),
  26. (9, 'ebayOrder脚本的跑的月范围', 'ebay_order_month_before', '10', '当前时间多少月之前的订单,进行处理', '2016-07-01 14:59:48', '2016-07-01 14:59:48', 'admin');
  27. ";
  28. $this->execute($sql2);
  29. }
  30. public function down()
  31. {
  32. echo "m160719_084110_admin_config cannot be reverted.\n";
  33. return false;
  34. }
  35. /*
  36. // Use safeUp/safeDown to run migration code within a transaction
  37. public function safeUp()
  38. {
  39. }
  40. public function safeDown()
  41. {
  42. }
  43. */
  44. }