20240423_sql.sql 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. DROP PROCEDURE IF EXISTS createCom;
  2. DELIMITER $$
  3. CREATE
  4. PROCEDURE createCom()
  5. BEGIN
  6. IF NOT EXISTS(SELECT 1 FROM information_schema.columns WHERE table_name='system_update_message' AND COLUMN_NAME = 'release_date') THEN
  7. ALTER TABLE `system_update_message`
  8. ADD COLUMN `release_date` DATETIME NULL COMMENT '发布时间';
  9. END IF;
  10. END$$
  11. DELIMITER ;
  12. CALL createCom;
  13. DROP PROCEDURE createCom;
  14. ALTER TABLE `base_student_school_roll`
  15. ADD INDEX (`class_id`),
  16. ADD INDEX (`grade_id`);
  17. DROP PROCEDURE IF EXISTS createCom;
  18. DELIMITER $$
  19. CREATE
  20. PROCEDURE createCom()
  21. BEGIN
  22. IF NOT EXISTS(SELECT 1 FROM information_schema.columns WHERE table_name='xjr_menu' AND COLUMN_NAME = 'is_show_servce') THEN
  23. ALTER TABLE `xjr_menu`
  24. ADD COLUMN `is_show_servce` SMALLINT DEFAULT 1 NULL COMMENT '是否显示在服务中心(0:否 1:是)' ;
  25. END IF;
  26. END$$
  27. DELIMITER ;
  28. CALL createCom;
  29. DROP PROCEDURE createCom;
  30. UPDATE xjr_menu SET is_show_servce = 1 WHERE is_show_servce IS NULL;
  31. ALTER TABLE `data_expert_source`
  32. DROP COLUMN `field_json`,
  33. CHANGE `api_url` `view_name` VARCHAR(50) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '视图名称';
  34. ALTER TABLE `base_student`
  35. ADD COLUMN `native_place_type` VARCHAR(50) NULL COMMENT '籍贯类型' ;
  36. DROP TABLE IF EXISTS data_expert_source;
  37. CREATE TABLE `data_expert_source` (
  38. `id` BIGINT NOT NULL,
  39. `create_user_id` BIGINT DEFAULT NULL,
  40. `create_date` DATETIME(3) DEFAULT NULL,
  41. `modify_user_id` BIGINT DEFAULT NULL,
  42. `modify_date` DATETIME(3) DEFAULT NULL,
  43. `delete_mark` INT DEFAULT NULL,
  44. `enabled_mark` INT DEFAULT NULL,
  45. `sort_code` INT DEFAULT NULL,
  46. `name` VARCHAR(100) DEFAULT NULL COMMENT '数据源名称',
  47. `source_type` VARCHAR(50) DEFAULT NULL COMMENT '数据源类型',
  48. `view_name` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '视图名称',
  49. PRIMARY KEY (`id`) USING BTREE
  50. ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='数据导出-数据源设置';
  51. DROP TABLE IF EXISTS data_expert_source_field;
  52. CREATE TABLE `data_expert_source_field` (
  53. `id` BIGINT NOT NULL,
  54. `create_user_id` BIGINT DEFAULT NULL,
  55. `create_date` DATETIME(3) DEFAULT NULL,
  56. `modify_user_id` BIGINT DEFAULT NULL,
  57. `modify_date` DATETIME(3) DEFAULT NULL,
  58. `delete_mark` INT DEFAULT NULL,
  59. `enabled_mark` INT DEFAULT NULL,
  60. `sort_code` INT DEFAULT NULL,
  61. `data_expert_source_id` BIGINT DEFAULT NULL COMMENT '数据源(data_expert_source)',
  62. `field_name` VARCHAR(100) DEFAULT NULL COMMENT '字段名称',
  63. `show_name` VARCHAR(50) DEFAULT NULL COMMENT '映射名称',
  64. `remarks` VARCHAR(50) DEFAULT NULL COMMENT '备注',
  65. `data_group` VARCHAR(50) DEFAULT NULL COMMENT '数据分组',
  66. PRIMARY KEY (`id`) USING BTREE
  67. ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='数据导出-数据源-字段设置';
  68. DROP TABLE IF EXISTS data_expert_template;
  69. CREATE TABLE `data_expert_template` (
  70. `id` BIGINT NOT NULL,
  71. `create_user_id` BIGINT DEFAULT NULL,
  72. `create_date` DATETIME(3) DEFAULT NULL,
  73. `modify_user_id` BIGINT DEFAULT NULL,
  74. `modify_date` DATETIME(3) DEFAULT NULL,
  75. `delete_mark` INT DEFAULT NULL,
  76. `enabled_mark` INT DEFAULT NULL,
  77. `sort_code` INT DEFAULT NULL,
  78. `name` VARCHAR(100) DEFAULT NULL COMMENT '模板名称',
  79. `data_expert_source_id` BIGINT DEFAULT NULL COMMENT '数据源(data_expert_source)',
  80. `field_json` LONGTEXT COMMENT '字段配置',
  81. PRIMARY KEY (`id`) USING BTREE
  82. ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='数据导出-数据模板';