Bladeren bron

sql: edit

Yi 1 jaar geleden
bovenliggende
commit
433e64db54
1 gewijzigde bestanden met toevoegingen van 9 en 14 verwijderingen
  1. 9 14
      migration/v0001_feedtemplet.sql

+ 9 - 14
migration/v0001_feedtemplet.sql

@@ -3,7 +3,14 @@ ALTER TABLE `feedtemplet`
     ADD COLUMN `group_data_id` bigint(11) unsigned NOT NULL DEFAULT '0' COMMENT '集团端数据ID',
     ADD COLUMN `group_version` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '集团端版本号';
 
-ALTER TABLE ftdetail ADD COLUMN `is_show` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否显示 0 无效 1 显示 2 隐藏';
+ALTER TABLE `ftdetail`
+    ADD COLUMN `is_modify` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否可修改 0 无效 1 是 2 否',
+    ADD COLUMN `is_show` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否显示 0 无效 1 显示 2 隐藏';
+ALTER TABLE cowclass ADD COLUMN group_id int(11) unsigned NOT NULL DEFAULT '0' COMMENT '集团端id';
+ALTER TABLE feedclass ADD COLUMN group_id int(11) unsigned NOT NULL DEFAULT '0' COMMENT '集团端id';
+ALTER TABLE USER ADD COLUMN `imei` VARCHAR(255) DEFAULT NULL;
+update feedtemplet set group_version = version;
+
 
 ## SELECT * FROM `apisql` where sqlname = 'getFTdetailList'
 SELECT
@@ -23,13 +30,6 @@ WHERE ftdetail.pastureid = ?   AND ( ftid=?) AND is_show = 1
   AND ( feedgroup LIKE CONCAT('%',?,'%')  OR ? = '')
 ORDER BY ftdetail.sort,ftdetail.id;
 
-
-
-update feedtemplet set group_version = version;
-
-ALTER TABLE `ftdetail`
-    ADD COLUMN `is_modify` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否可修改 0 无效 1 是 2 否';
-
 ## SELECT * FROM apisql WHERE sqlname = 'getFTList' AND ENABLE >0
 ## 需要更新的语句如下
 SELECT * FROM ( SELECT
@@ -53,12 +53,7 @@ WHERE pastureid = ?
   AND (fttype LIKE CONCAT("%",?,"%") OR ?='')
 ) f
 WHERE (f.enable = ? OR ? = '' ) AND (isadjust = ? OR ? = '') AND (source = IF( ? = 0 ,"自定义",IF (? = 1,"集团下发未调整",IF(? = 2,"集团下发有调整",IF(? = 3 ,"导入","")))) OR ? = '')
-ORDER BY  f.sort ASC;
-
-
-ALTER TABLE cowclass ADD COLUMN group_id int(11) unsigned NOT NULL DEFAULT '0' COMMENT '集团端id';
-ALTER TABLE feedclass ADD COLUMN group_id int(11) unsigned NOT NULL DEFAULT '0' COMMENT '集团端id';
-ALTER TABLE USER ADD COLUMN `imei` VARCHAR(255) DEFAULT NULL;
+ORDER BY  f.id DESC;
 
 ##  SELECT * FROM apisql WHERE sqlname  ='updatesysopt'
 ## 需要更新的语句如下sqlstr