bladex-update-postgresql-3.0.0~3.0.1.sql 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. -- -----------------------------------
  2. -- 给代码生成添加字段
  3. -- -----------------------------------
  4. ALTER TABLE "blade_code" RENAME COLUMN "datasource_id" TO "model_id";
  5. COMMENT ON COLUMN "blade_code"."model_id" IS '数据模型主键';
  6. -- -----------------------------------
  7. -- 新增 代码生成表字段类型
  8. -- -----------------------------------
  9. ALTER TABLE "blade_code"
  10. ADD COLUMN "template_type" varchar(32),
  11. ADD COLUMN "author" varchar(32),
  12. ADD COLUMN "sub_model_id" varchar(32),
  13. ADD COLUMN "sub_fk_id" varchar(32),
  14. ADD COLUMN "tree_id" varchar(32),
  15. ADD COLUMN "tree_pid" varchar(32),
  16. ADD COLUMN "tree_name" varchar(64);
  17. COMMENT ON COLUMN "blade_code"."template_type" IS '模版类型';
  18. COMMENT ON COLUMN "blade_code"."author" IS '作者信息';
  19. COMMENT ON COLUMN "blade_code"."sub_model_id" IS '子表模型主键';
  20. COMMENT ON COLUMN "blade_code"."sub_fk_id" IS '子表绑定外键';
  21. COMMENT ON COLUMN "blade_code"."tree_id" IS '树主键字段';
  22. COMMENT ON COLUMN "blade_code"."tree_pid" IS '树父主键字段';
  23. COMMENT ON COLUMN "blade_code"."tree_name" IS '树名称字段';
  24. -- -----------------------------------
  25. -- 新增模型设计菜单
  26. -- -----------------------------------
  27. INSERT INTO "blade_menu"("id", "parent_id", "code", "name", "alias", "path", "source", "sort", "category", "action", "is_open", "component", "remark", "is_deleted") VALUES (1161272593873321996, 1123598815738675217, 'model', '数据模型设计', 'menu', '/tool/model', 'iconfont icon-biaodan', 3, 1, 0, 1, '', '', 0);
  28. -- -----------------------------------
  29. -- 新增 数据模型表
  30. -- -----------------------------------
  31. CREATE TABLE "blade_model" (
  32. "id" int8 NOT NULL,
  33. "datasource_id" int8,
  34. "model_name" varchar(50) COLLATE "pg_catalog"."default",
  35. "model_code" varchar(50) COLLATE "pg_catalog"."default",
  36. "model_table" varchar(100) COLLATE "pg_catalog"."default",
  37. "model_class" varchar(100) COLLATE "pg_catalog"."default",
  38. "model_remark" varchar(500) COLLATE "pg_catalog"."default",
  39. "create_user" int8,
  40. "create_dept" int8,
  41. "create_time" timestamp(6),
  42. "update_user" int8,
  43. "update_time" timestamp(6),
  44. "status" int4,
  45. "is_deleted" int4,
  46. PRIMARY KEY ("id")
  47. )
  48. ;
  49. COMMENT ON COLUMN "blade_model"."id" IS '主键';
  50. COMMENT ON COLUMN "blade_model"."datasource_id" IS '数据源主键';
  51. COMMENT ON COLUMN "blade_model"."model_name" IS '模型名称';
  52. COMMENT ON COLUMN "blade_model"."model_code" IS '模型编号';
  53. COMMENT ON COLUMN "blade_model"."model_table" IS '物理表名';
  54. COMMENT ON COLUMN "blade_model"."model_class" IS '模型类名';
  55. COMMENT ON COLUMN "blade_model"."model_remark" IS '模型备注';
  56. COMMENT ON COLUMN "blade_model"."create_user" IS '创建人';
  57. COMMENT ON COLUMN "blade_model"."create_dept" IS '创建部门';
  58. COMMENT ON COLUMN "blade_model"."create_time" IS '创建时间';
  59. COMMENT ON COLUMN "blade_model"."update_user" IS '修改人';
  60. COMMENT ON COLUMN "blade_model"."update_time" IS '修改时间';
  61. COMMENT ON COLUMN "blade_model"."status" IS '状态';
  62. COMMENT ON COLUMN "blade_model"."is_deleted" IS '是否已删除';
  63. COMMENT ON TABLE "blade_model" IS '数据模型表';
  64. -- -----------------------------------
  65. -- 新增 数据原型表
  66. -- -----------------------------------
  67. CREATE TABLE "blade_model_prototype" (
  68. "id" int8 NOT NULL,
  69. "model_id" int8,
  70. "jdbc_name" varchar(50) COLLATE "pg_catalog"."default",
  71. "jdbc_type" varchar(20) COLLATE "pg_catalog"."default",
  72. "comment" varchar(500) COLLATE "pg_catalog"."default",
  73. "property_type" varchar(20) COLLATE "pg_catalog"."default",
  74. "property_entity" varchar(500) COLLATE "pg_catalog"."default",
  75. "property_name" varchar(50) COLLATE "pg_catalog"."default",
  76. "is_list" int4,
  77. "is_form" int4,
  78. "is_row" int4,
  79. "component_type" varchar(50) COLLATE "pg_catalog"."default",
  80. "dict_code" varchar(50) COLLATE "pg_catalog"."default",
  81. "is_required" int4,
  82. "validate_type" varchar(50) COLLATE "pg_catalog"."default",
  83. "is_query" int4,
  84. "query_type" varchar(50) COLLATE "pg_catalog"."default",
  85. "create_user" int8,
  86. "create_dept" int8,
  87. "create_time" timestamp(6),
  88. "update_user" int8,
  89. "update_time" timestamp(6),
  90. "status" int4,
  91. "is_deleted" int4,
  92. PRIMARY KEY ("id")
  93. )
  94. ;
  95. COMMENT ON COLUMN "blade_model_prototype"."id" IS '主键';
  96. COMMENT ON COLUMN "blade_model_prototype"."model_id" IS '模型主键';
  97. COMMENT ON COLUMN "blade_model_prototype"."jdbc_name" IS '物理列名';
  98. COMMENT ON COLUMN "blade_model_prototype"."jdbc_type" IS '物理类型';
  99. COMMENT ON COLUMN "blade_model_prototype"."comment" IS '注释说明';
  100. COMMENT ON COLUMN "blade_model_prototype"."property_type" IS '实体类型';
  101. COMMENT ON COLUMN "blade_model_prototype"."property_entity" IS '实体类型引用';
  102. COMMENT ON COLUMN "blade_model_prototype"."property_name" IS '实体列名';
  103. COMMENT ON COLUMN "blade_model_prototype"."is_list" IS '列表显示';
  104. COMMENT ON COLUMN "blade_model_prototype"."is_form" IS '表单显示';
  105. COMMENT ON COLUMN "blade_model_prototype"."is_row" IS '独占一行';
  106. COMMENT ON COLUMN "blade_model_prototype"."component_type" IS '组件类型';
  107. COMMENT ON COLUMN "blade_model_prototype"."dict_code" IS '字典编码';
  108. COMMENT ON COLUMN "blade_model_prototype"."is_required" IS '是否必填';
  109. COMMENT ON COLUMN "blade_model_prototype"."validate_type" IS '验证类型';
  110. COMMENT ON COLUMN "blade_model_prototype"."is_query" IS '查询配置';
  111. COMMENT ON COLUMN "blade_model_prototype"."query_type" IS '查询类型';
  112. COMMENT ON COLUMN "blade_model_prototype"."create_user" IS '创建人';
  113. COMMENT ON COLUMN "blade_model_prototype"."create_dept" IS '创建部门';
  114. COMMENT ON COLUMN "blade_model_prototype"."create_time" IS '创建时间';
  115. COMMENT ON COLUMN "blade_model_prototype"."update_user" IS '修改人';
  116. COMMENT ON COLUMN "blade_model_prototype"."update_time" IS '修改时间';
  117. COMMENT ON COLUMN "blade_model_prototype"."status" IS '状态';
  118. COMMENT ON COLUMN "blade_model_prototype"."is_deleted" IS '是否已删除';
  119. COMMENT ON TABLE "blade_model_prototype" IS '数据原型表';