Browse Source

fix: pg,mssql dual表需要一条数据

dhb52 10 months ago
parent
commit
7d9e6f2184
3 changed files with 40 additions and 7 deletions
  1. 10 1
      sql/postgresql/ruoyi-vue-pro.sql
  2. 9 2
      sql/sqlserver/ruoyi-vue-pro.sql
  3. 21 4
      sql/tools/convertor.py

+ 10 - 1
sql/postgresql/ruoyi-vue-pro.sql

@@ -5,7 +5,7 @@
 
  Target Server Type    : PostgreSQL
 
- Date: 2024-05-03 23:36:19
+ Date: 2024-05-08 00:11:06
 */
 
 
@@ -15,8 +15,17 @@
 DROP TABLE IF EXISTS dual;
 CREATE TABLE dual
 (
+    id int2
 );
 
+COMMENT ON TABLE dual IS '数据库连接的表';
+
+-- ----------------------------
+-- Records of dual
+-- ----------------------------
+-- @formatter:off
+INSERT INTO dual VALUES (1);
+-- @formatter:on
 
 -- ----------------------------
 -- Table structure for infra_api_access_log

+ 9 - 2
sql/sqlserver/ruoyi-vue-pro.sql

@@ -5,7 +5,7 @@
 
  Target Server Type    : Microsoft SQL Server
 
- Date: 2024-05-03 23:36:38
+ Date: 2024-05-08 00:22:09
 */
 
 
@@ -17,7 +17,7 @@ GO
 
 CREATE TABLE dual
 (
-    id int NULL
+    id int
 )
 GO
 
@@ -27,6 +27,13 @@ EXEC sp_addextendedproperty
      'TABLE', N'dual'
 GO
 
+-- ----------------------------
+-- Records of dual
+-- ----------------------------
+-- @formatter:off
+INSERT INTO dual VALUES (1)
+GO
+-- @formatter:on
 
 -- ----------------------------
 -- Table structure for infra_api_access_log

+ 21 - 4
sql/tools/convertor.py

@@ -207,7 +207,6 @@ class Convertor(ABC):
 -- Table structure for dual
 -- ----------------------------
 {dual}
-
 """
             )
 
@@ -371,7 +370,17 @@ CREATE SEQUENCE {table_name}_seq
         return """DROP TABLE IF EXISTS dual;
 CREATE TABLE dual
 (
-);"""
+    id int2
+);
+
+COMMENT ON TABLE dual IS '数据库连接的表';
+
+-- ----------------------------
+-- Records of dual
+-- ----------------------------
+-- @formatter:off
+INSERT INTO dual VALUES (1);
+-- @formatter:on"""
 
 
 class OracleConvertor(Convertor):
@@ -636,7 +645,7 @@ GO
 
 CREATE TABLE dual
 (
-  id int NULL
+  id int
 )
 GO
 
@@ -644,7 +653,15 @@ EXEC sp_addextendedproperty
     'MS_Description', N'数据库连接的表',
     'SCHEMA', N'dbo',
     'TABLE', N'dual'
-GO"""
+GO
+
+-- ----------------------------
+-- Records of dual
+-- ----------------------------
+-- @formatter:off
+INSERT INTO dual VALUES (1)
+GO
+-- @formatter:on"""
 
 
 class DM8Convertor(Convertor):