diff --git a/.qoder/skills/create-pr-himarket/SKILL.md b/.qoder/skills/create-pr-himarket/SKILL.md deleted file mode 100644 index f57d682f4..000000000 --- a/.qoder/skills/create-pr-himarket/SKILL.md +++ /dev/null @@ -1,278 +0,0 @@ ---- -name: create-pr-himarket -description: "为 HiMarket 项目创建符合规范的 Pull Request。当用户需要提交代码、推送分支或创建 PR 时使用此 skill,确保 PR 标题和内容符合项目 CI 检查要求。" ---- - -# 创建 HiMarket Pull Request - -## 概述 - -帮助用户在 [higress-group/himarket](https://github.com/higress-group/himarket) 仓库创建符合规范的 Pull Request,确保通过 PR Title Check、PR Content Check 和 PR Size Check。 - -## PR 标题格式 - -### 必需格式 - -``` -type: 简短描述 -``` - -或带范围: - -``` -type(scope): 简短描述 -``` - -### 允许的 Type - -| Type | 说明 | 示例 | -|------|------|------| -| `feat` | 新功能 | `feat: add user authentication` | -| `fix` | Bug 修复 | `fix: resolve memory leak` | -| `docs` | 文档更新 | `docs: update API documentation` | -| `style` | 代码格式 | `style: format with prettier` | -| `refactor` | 重构 | `refactor: simplify service logic` | -| `perf` | 性能优化 | `perf: optimize queries` | -| `test` | 测试 | `test: add unit tests` | -| `build` | 构建系统 | `build: update dependencies` | -| `ci` | CI/CD | `ci: add workflow` | -| `chore` | 其他变更 | `chore: update gitignore` | -| `revert` | 回滚 | `revert: revert commit abc123` | - -### 标题规则 - -1. 必须包含 type 前缀 -2. type 后需要冒号和空格:`feat: ` 而不是 `feat:` -3. 描述必须以**小写字母**开头 -4. 保持简短清晰(建议 < 50 字符) - -## PR 内容格式(必填) - -### 必填部分 - -#### 1. Description(必填) - -必须包含 `## 📝 Description` 部分,且内容至少 10 个字符。 - -```markdown -## 📝 Description - -- 变更点 1 -- 变更点 2 -- 变更点 3 -``` - -#### 2. Type of Change(必填) - -必须至少勾选一项变更类型。 - -```markdown -## ✅ Type of Change - -- [x] Bug fix (non-breaking change) -- [ ] New feature (non-breaking change) -- [ ] Breaking change -- [ ] Documentation update -- [ ] Code refactoring -- [ ] Performance improvement -``` - -### 可选部分 - -#### 3. Related Issues(推荐) - -```markdown -## 🔗 Related Issues - -Fix #123 -Close #456 -``` - -#### 4. Testing(推荐) - -```markdown -## 🧪 Testing - -- [x] Unit tests added/updated -- [x] Manual testing completed -- 测试场景描述 -``` - -#### 5. Checklist(推荐) - -```markdown -## 📋 Checklist - -- [x] Code has been formatted (`mvn spotless:apply` for backend, `npm run lint:fix` for frontend) -- [x] Code is self-reviewed -- [x] No breaking changes -- [x] All CI checks pass -``` - -## 工作流程 - -### 步骤 1:检查当前状态 - -```bash -# 并行执行以下命令 -git status -git diff --stat -git log --oneline -5 -git branch -a -git remote -v -``` - -### 步骤 2:确认分支和远程 - -- 确认当前分支名称 -- 确认 origin 指向用户的 fork(如 `lexburner/himarket`) -- 确认 upstream 指向主仓库(`higress-group/himarket`) - -### 步骤 3:推送分支 - -```bash -git push -u origin -``` - -### 步骤 4:创建 PR - -使用 HEREDOC 格式确保内容正确: - -```bash -gh pr create --repo higress-group/himarket \ - --base main \ - --head : \ - --title "feat: 简短描述" \ - --body "$(cat <<'EOF' -## 📝 Description - -- 变更点 1 -- 变更点 2 - -## 🔗 Related Issues - -Fix #123 - -## ✅ Type of Change - -- [ ] Bug fix (non-breaking change) -- [x] New feature (non-breaking change) -- [ ] Breaking change -- [ ] Documentation update -- [ ] Code refactoring -- [ ] Performance improvement - -## 🧪 Testing - -- [x] Unit tests pass locally -- [x] Manual testing completed - -## 📋 Checklist - -- [x] Code has been formatted (`mvn spotless:apply` for backend, `npm run lint:fix` for frontend) -- [x] Code is self-reviewed -- [x] No breaking changes -- [x] All CI checks pass -EOF -)" -``` - -### 步骤 5:验证检查状态 - -```bash -gh pr checks --repo higress-group/himarket -``` - -确保以下检查通过: -- PR Title Check -- PR Content Check -- PR Size Check -- PR Validation Summary - -## 关键原则 - -- **标题小写** - 描述部分必须以小写字母开头 -- **内容完整** - 必须包含 `## 📝 Description` 和 `## ✅ Type of Change` -- **勾选类型** - Type of Change 必须至少勾选一项 `[x]` -- **关联 Issue** - 推荐使用 `Fix #123` 格式关联 Issue -- **格式化代码** - 提交前运行 `mvn spotless:apply` 或 `npm run lint:fix` -- **不提交图片** - 避免将截图等二进制文件提交到仓库 - -## 常见错误 - -### 错误 1:标题首字母大写 - -``` -❌ feat: Add new feature -✅ feat: add new feature -``` - -### 错误 2:缺少 Description 标题 - -```markdown -❌ 直接写内容 -✅ ## 📝 Description - 内容 -``` - -### 错误 3:未勾选 Type of Change - -```markdown -❌ - [ ] New feature -✅ - [x] New feature -``` - -### 错误 4:Description 内容太短 - -```markdown -❌ ## 📝 Description - Fix bug - -✅ ## 📝 Description - Fix pagination bug in product list -``` - -## 完整示例 - -**标题:** -``` -feat(chat): add tool call support and stop generation feature -``` - -**内容:** -```markdown -## 📝 Description - -- 添加聊天工具调用(Tool Call)支持,工具执行状态按消息顺序内联展示 -- 添加停止生成过程功能,支持中断正在进行的 AI 回复 -- 优化模型推理时滚动条自由滑动体验 - -## 🔗 Related Issues - -Fix #163 -Fix #164 -Fix #165 - -## ✅ Type of Change - -- [x] Bug fix (non-breaking change) -- [x] New feature (non-breaking change) -- [ ] Breaking change -- [ ] Documentation update -- [ ] Code refactoring -- [ ] Performance improvement - -## 🧪 Testing - -- [x] Unit tests pass locally -- [x] Manual testing completed -- 测试停止按钮能否正常中断 SSE 流式请求 -- 测试模型推理时滚动条是否可自由滑动 - -## 📋 Checklist - -- [x] Code has been formatted (`mvn spotless:apply` for backend, `npm run lint:fix` for frontend) -- [x] Code is self-reviewed -- [x] No breaking changes -- [x] All CI checks pass -``` diff --git a/deploy/helm/nacos/sql/mysql-schema.sql b/deploy/helm/nacos/sql/mysql-schema.sql index 2d2e66d70..93daddcbc 100644 --- a/deploy/helm/nacos/sql/mysql-schema.sql +++ b/deploy/helm/nacos/sql/mysql-schema.sql @@ -177,3 +177,70 @@ CREATE TABLE IF NOT EXISTS `permissions` ( UNIQUE INDEX `uk_role_permission` (`role`,`resource`,`action`) USING BTREE ); + +/******************************************/ +/* 表名称 = pipeline_execution */ +/******************************************/ +CREATE TABLE IF NOT EXISTS `pipeline_execution` ( + `execution_id` varchar(64) NOT NULL COMMENT '执行ID', + `resource_type` varchar(32) NOT NULL COMMENT '资源类型', + `resource_name` varchar(256) NOT NULL COMMENT '资源名称', + `namespace_id` varchar(128) DEFAULT NULL COMMENT '命名空间ID', + `version` varchar(64) DEFAULT NULL COMMENT '版本', + `status` varchar(32) NOT NULL COMMENT '执行状态', + `pipeline` longtext NOT NULL COMMENT 'pipeline节点结果JSON', + `create_time` bigint(20) NOT NULL COMMENT '创建时间', + `update_time` bigint(20) NOT NULL COMMENT '修改时间', + PRIMARY KEY (`execution_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='AI资源发布审核Pipeline执行记录'; + +/******************************************/ +/* 表名称 = ai_resource */ +/******************************************/ +CREATE TABLE IF NOT EXISTS `ai_resource` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id', + `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间', + `name` varchar(256) NOT NULL COMMENT '资源名称', + `type` varchar(32) NOT NULL COMMENT '资源类型', + `c_desc` varchar(2048) DEFAULT NULL COMMENT '资源描述', + `status` varchar(32) DEFAULT NULL COMMENT '资源状态', + `namespace_id` varchar(128) NOT NULL DEFAULT '' COMMENT '命名空间ID', + `biz_tags` varchar(1024) DEFAULT NULL COMMENT '业务标签', + `ext` longtext DEFAULT NULL COMMENT '扩展信息(JSON)', + `version_info` longtext DEFAULT NULL COMMENT '版本信息(JSON)', + `meta_version` bigint(20) NOT NULL DEFAULT 1 COMMENT '元数据版本(乐观锁)', + `scope` varchar(16) NOT NULL DEFAULT 'PRIVATE' COMMENT '可见性: PUBLIC/PRIVATE', + `owner` varchar(128) NOT NULL DEFAULT '' COMMENT '创建者用户名', + `download_count` bigint(20) NOT NULL DEFAULT 0 COMMENT '下载次数', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_ai_resource_ns_name_type` (`namespace_id`,`name`,`type`), + KEY `idx_ai_resource_name` (`name`), + KEY `idx_ai_resource_type` (`type`), + KEY `idx_ai_resource_gmt_modified` (`gmt_modified`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='AI资源元数据表'; + +/******************************************/ +/* 表名称 = ai_resource_version */ +/******************************************/ +CREATE TABLE IF NOT EXISTS `ai_resource_version` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id', + `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间', + `type` varchar(32) NOT NULL COMMENT '资源类型', + `author` varchar(128) DEFAULT NULL COMMENT '作者', + `name` varchar(256) NOT NULL COMMENT '资源名称', + `c_desc` varchar(2048) DEFAULT NULL COMMENT '版本描述', + `status` varchar(32) NOT NULL COMMENT '版本状态', + `version` varchar(64) NOT NULL COMMENT '版本号', + `namespace_id` varchar(128) NOT NULL DEFAULT '' COMMENT '命名空间ID', + `storage` longtext DEFAULT NULL COMMENT '存储信息(JSON)', + `publish_pipeline_info` longtext DEFAULT NULL COMMENT '发布流水线信息(JSON)', + `download_count` bigint(20) NOT NULL DEFAULT 0 COMMENT '下载次数', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_ai_resource_ver_ns_name_type_ver` (`namespace_id`,`name`,`type`,`version`), + KEY `idx_ai_resource_ver_name` (`name`), + KEY `idx_ai_resource_ver_status` (`status`), + KEY `idx_ai_resource_ver_gmt_modified` (`gmt_modified`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='AI资源版本表'; + diff --git a/deploy/helm/nacos/sql/pg-schema.sql b/deploy/helm/nacos/sql/pg-schema.sql deleted file mode 100644 index e6987ae7b..000000000 --- a/deploy/helm/nacos/sql/pg-schema.sql +++ /dev/null @@ -1,410 +0,0 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - --- ---------------------------- --- Table structure for config_info --- ---------------------------- -DROP TABLE IF EXISTS "config_info"; -CREATE TABLE "config_info" ( - "id" bigserial NOT NULL, - "data_id" varchar(255) NOT NULL, - "group_id" varchar(255) , - "content" text NOT NULL, - "md5" varchar(32) , - "gmt_create" timestamp(6) NOT NULL, - "gmt_modified" timestamp(6) NOT NULL, - "src_user" text , - "src_ip" varchar(20) , - "app_name" varchar(128) , - "tenant_id" varchar(128) , - "c_desc" varchar(256) , - "c_use" varchar(64) , - "effect" varchar(64) , - "type" varchar(64) , - "c_schema" text , - "encrypted_data_key" text NOT NULL -) -; - -COMMENT ON COLUMN "config_info"."id" IS 'id'; -COMMENT ON COLUMN "config_info"."data_id" IS 'data_id'; -COMMENT ON COLUMN "config_info"."content" IS 'content'; -COMMENT ON COLUMN "config_info"."md5" IS 'md5'; -COMMENT ON COLUMN "config_info"."gmt_create" IS '创建时间'; -COMMENT ON COLUMN "config_info"."gmt_modified" IS '修改时间'; -COMMENT ON COLUMN "config_info"."src_user" IS 'source user'; -COMMENT ON COLUMN "config_info"."src_ip" IS 'source ip'; -COMMENT ON COLUMN "config_info"."tenant_id" IS '租户字段'; -COMMENT ON COLUMN "config_info"."encrypted_data_key" IS '秘钥'; -COMMENT ON TABLE "config_info" IS 'config_info'; - --- ---------------------------- --- Table structure for config_info_gray --- ---------------------------- -DROP TABLE IF EXISTS "config_info_gray"; -CREATE TABLE "config_info_gray" ( - "id" bigserial NOT NULL, - "data_id" varchar(255) NOT NULL, - "group_id" varchar(128) NOT NULL, - "content" text NOT NULL, - "md5" varchar(32), - "src_user" text, - "src_ip" varchar(100), - "gmt_create" timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "gmt_modified" timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "app_name" varchar(128), - "tenant_id" varchar(128) DEFAULT '', - "gray_name" varchar(128) NOT NULL, - "gray_rule" text NOT NULL, - "encrypted_data_key" varchar(256) NOT NULL DEFAULT '' -); - -COMMENT ON COLUMN "config_info_gray"."id" IS 'id'; -COMMENT ON COLUMN "config_info_gray"."data_id" IS 'data_id'; -COMMENT ON COLUMN "config_info_gray"."group_id" IS 'group_id'; -COMMENT ON COLUMN "config_info_gray"."content" IS 'content'; -COMMENT ON COLUMN "config_info_gray"."md5" IS 'md5'; -COMMENT ON COLUMN "config_info_gray"."src_user" IS 'source user'; -COMMENT ON COLUMN "config_info_gray"."src_ip" IS 'source ip'; -COMMENT ON COLUMN "config_info_gray"."gmt_create" IS '创建时间'; -COMMENT ON COLUMN "config_info_gray"."gmt_modified" IS '修改时间'; -COMMENT ON COLUMN "config_info_gray"."app_name" IS 'app_name'; -COMMENT ON COLUMN "config_info_gray"."tenant_id" IS '租户字段'; -COMMENT ON COLUMN "config_info_gray"."gray_name" IS '灰度名称'; -COMMENT ON COLUMN "config_info_gray"."gray_rule" IS '灰度规则'; -COMMENT ON COLUMN "config_info_gray"."encrypted_data_key" IS '秘钥'; -COMMENT ON TABLE "config_info_gray" IS 'config_info_gray'; - --- 创建索引 -CREATE UNIQUE INDEX "uk_configinfogray_datagrouptenantgray" ON "config_info_gray" USING btree ("data_id", "group_id", "tenant_id", "gray_name"); -CREATE INDEX "idx_dataid_gmt_modified_gray" ON "config_info_gray" USING btree ("data_id", "gmt_modified"); -CREATE INDEX "idx_gmt_modified_gray" ON "config_info_gray" USING btree ("gmt_modified"); - -ALTER TABLE "config_info_gray" ADD CONSTRAINT "config_info_gray_pkey" PRIMARY KEY ("id"); - --- ---------------------------- --- Records of config_info_gray --- ---------------------------- -BEGIN; -COMMIT; - - --- ---------------------------- --- Table structure for config_tags_relation --- ---------------------------- -DROP TABLE IF EXISTS "config_tags_relation"; -CREATE TABLE "config_tags_relation" ( - "id" bigint NOT NULL, - "tag_name" varchar(128) NOT NULL, - "tag_type" varchar(64) , - "data_id" varchar(255) NOT NULL, - "group_id" varchar(128) NOT NULL, - "tenant_id" varchar(128) , - "nid" bigserial NOT NULL -) -; -COMMENT ON COLUMN "config_tags_relation"."id" IS 'id'; -COMMENT ON COLUMN "config_tags_relation"."tag_name" IS 'tag_name'; -COMMENT ON COLUMN "config_tags_relation"."tag_type" IS 'tag_type'; -COMMENT ON COLUMN "config_tags_relation"."data_id" IS 'data_id'; -COMMENT ON COLUMN "config_tags_relation"."group_id" IS 'group_id'; -COMMENT ON COLUMN "config_tags_relation"."tenant_id" IS 'tenant_id'; -COMMENT ON TABLE "config_tags_relation" IS 'config_tag_relation'; - --- ---------------------------- --- Records of config_tags_relation --- ---------------------------- -BEGIN; -COMMIT; - --- ---------------------------- --- Table structure for group_capacity --- ---------------------------- -DROP TABLE IF EXISTS "group_capacity"; -CREATE TABLE "group_capacity" ( - "id" bigserial NOT NULL, - "group_id" varchar(128) NOT NULL, - "quota" int4 NOT NULL, - "usage" int4 NOT NULL, - "max_size" int4 NOT NULL, - "max_aggr_count" int4 NOT NULL, - "max_aggr_size" int4 NOT NULL, - "max_history_count" int4 NOT NULL, - "gmt_create" timestamp(6) NOT NULL, - "gmt_modified" timestamp(6) NOT NULL -) -; -COMMENT ON COLUMN "group_capacity"."id" IS '主键ID'; -COMMENT ON COLUMN "group_capacity"."group_id" IS 'Group ID,空字符表示整个集群'; -COMMENT ON COLUMN "group_capacity"."quota" IS '配额,0表示使用默认值'; -COMMENT ON COLUMN "group_capacity"."usage" IS '使用量'; -COMMENT ON COLUMN "group_capacity"."max_size" IS '单个配置大小上限,单位为字节,0表示使用默认值'; -COMMENT ON COLUMN "group_capacity"."max_aggr_count" IS '聚合子配置最大个数,,0表示使用默认值'; -COMMENT ON COLUMN "group_capacity"."max_aggr_size" IS '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值'; -COMMENT ON COLUMN "group_capacity"."max_history_count" IS '最大变更历史数量'; -COMMENT ON COLUMN "group_capacity"."gmt_create" IS '创建时间'; -COMMENT ON COLUMN "group_capacity"."gmt_modified" IS '修改时间'; -COMMENT ON TABLE "group_capacity" IS '集群、各Group容量信息表'; - --- ---------------------------- --- Records of group_capacity --- ---------------------------- -BEGIN; -COMMIT; - --- ---------------------------- --- Table structure for his_config_info --- ---------------------------- -DROP TABLE IF EXISTS "his_config_info"; -CREATE TABLE "his_config_info" ( - "id" int8 NOT NULL, - "nid" bigserial NOT NULL, - "data_id" varchar(255) NOT NULL, - "group_id" varchar(128) NOT NULL, - "app_name" varchar(128) , - "content" text NOT NULL, - "md5" varchar(32) , - "gmt_create" timestamp(6) NOT NULL DEFAULT '2010-05-05 00:00:00', - "gmt_modified" timestamp(6) NOT NULL, - "src_user" text , - "src_ip" varchar(20) , - "op_type" char(10) , - "tenant_id" varchar(128) , - "encrypted_data_key" text NOT NULL, - "publish_type" varchar(50) DEFAULT 'formal', - "gray_name" varchar(50), - "ext_info" text -) -; -COMMENT ON COLUMN "his_config_info"."app_name" IS 'app_name'; -COMMENT ON COLUMN "his_config_info"."tenant_id" IS '租户字段'; -COMMENT ON COLUMN "his_config_info"."encrypted_data_key" IS '秘钥'; -COMMENT ON COLUMN "his_config_info"."publish_type" IS 'publish type gray or formal'; -COMMENT ON COLUMN "his_config_info"."gray_name" IS 'gray name'; -COMMENT ON COLUMN "his_config_info"."ext_info" IS 'ext info'; -COMMENT ON TABLE "his_config_info" IS '多租户改造'; - - --- ---------------------------- --- Table structure for permissions --- ---------------------------- -DROP TABLE IF EXISTS "permissions"; -CREATE TABLE "permissions" ( - "role" varchar(50) NOT NULL, - "resource" varchar(512) NOT NULL, - "action" varchar(8) NOT NULL -) -; - --- ---------------------------- --- Records of permissions --- ---------------------------- -BEGIN; -COMMIT; - --- ---------------------------- --- Table structure for roles --- ---------------------------- -DROP TABLE IF EXISTS "roles"; -CREATE TABLE "roles" ( - "username" varchar(50) NOT NULL, - "role" varchar(50) NOT NULL -) -; - --- ---------------------------- --- Records of roles --- ---------------------------- -BEGIN; -INSERT INTO "roles" VALUES ('nacos', 'ROLE_ADMIN'); -COMMIT; - --- ---------------------------- --- Table structure for tenant_capacity --- ---------------------------- -DROP TABLE IF EXISTS "tenant_capacity"; -CREATE TABLE "tenant_capacity" ( - "id" bigserial NOT NULL, - "tenant_id" varchar(128) NOT NULL, - "quota" int4 NOT NULL, - "usage" int4 NOT NULL, - "max_size" int4 NOT NULL, - "max_aggr_count" int4 NOT NULL, - "max_aggr_size" int4 NOT NULL, - "max_history_count" int4 NOT NULL, - "gmt_create" timestamp(6) NOT NULL, - "gmt_modified" timestamp(6) NOT NULL -) -; -COMMENT ON COLUMN "tenant_capacity"."id" IS '主键ID'; -COMMENT ON COLUMN "tenant_capacity"."tenant_id" IS 'Tenant ID'; -COMMENT ON COLUMN "tenant_capacity"."quota" IS '配额,0表示使用默认值'; -COMMENT ON COLUMN "tenant_capacity"."usage" IS '使用量'; -COMMENT ON COLUMN "tenant_capacity"."max_size" IS '单个配置大小上限,单位为字节,0表示使用默认值'; -COMMENT ON COLUMN "tenant_capacity"."max_aggr_count" IS '聚合子配置最大个数'; -COMMENT ON COLUMN "tenant_capacity"."max_aggr_size" IS '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值'; -COMMENT ON COLUMN "tenant_capacity"."max_history_count" IS '最大变更历史数量'; -COMMENT ON COLUMN "tenant_capacity"."gmt_create" IS '创建时间'; -COMMENT ON COLUMN "tenant_capacity"."gmt_modified" IS '修改时间'; -COMMENT ON TABLE "tenant_capacity" IS '租户容量信息表'; - --- ---------------------------- --- Records of tenant_capacity --- ---------------------------- -BEGIN; -COMMIT; - --- ---------------------------- --- Table structure for tenant_info --- ---------------------------- -DROP TABLE IF EXISTS "tenant_info"; -CREATE TABLE "tenant_info" ( - "id" bigserial NOT NULL, - "kp" varchar(128) NOT NULL, - "tenant_id" varchar(128) , - "tenant_name" varchar(128) , - "tenant_desc" varchar(256) , - "create_source" varchar(32) , - "gmt_create" int8 NOT NULL, - "gmt_modified" int8 NOT NULL -) -; -COMMENT ON COLUMN "tenant_info"."id" IS 'id'; -COMMENT ON COLUMN "tenant_info"."kp" IS 'kp'; -COMMENT ON COLUMN "tenant_info"."tenant_id" IS 'tenant_id'; -COMMENT ON COLUMN "tenant_info"."tenant_name" IS 'tenant_name'; -COMMENT ON COLUMN "tenant_info"."tenant_desc" IS 'tenant_desc'; -COMMENT ON COLUMN "tenant_info"."create_source" IS 'create_source'; -COMMENT ON COLUMN "tenant_info"."gmt_create" IS '创建时间'; -COMMENT ON COLUMN "tenant_info"."gmt_modified" IS '修改时间'; -COMMENT ON TABLE "tenant_info" IS 'tenant_info'; - --- ---------------------------- --- Records of tenant_info --- ---------------------------- -BEGIN; -COMMIT; - --- ---------------------------- --- Table structure for users --- ---------------------------- -DROP TABLE IF EXISTS "users"; -CREATE TABLE "users" ( - "username" varchar(50) NOT NULL, - "password" varchar(500) NOT NULL, - "enabled" boolean NOT NULL -) -; - --- ---------------------------- --- Records of users --- ---------------------------- -BEGIN; -COMMIT; - --- ---------------------------- --- Indexes structure for table config_info --- ---------------------------- -CREATE UNIQUE INDEX "uk_configinfo_datagrouptenant" ON "config_info" ("data_id","group_id","tenant_id"); - --- ---------------------------- --- Primary Key structure for table config_info --- ---------------------------- -ALTER TABLE "config_info" ADD CONSTRAINT "config_info_pkey" PRIMARY KEY ("id"); - --- ---------------------------- --- Indexes structure for table config_tags_relation --- ---------------------------- -CREATE INDEX "idx_tenant_id" ON "config_tags_relation" USING btree ( - "tenant_id" -); -CREATE UNIQUE INDEX "uk_configtagrelation_configidtag" ON "config_tags_relation" USING btree ( - "id", - "tag_name", - "tag_type" -); - --- ---------------------------- --- Primary Key structure for table config_tags_relation --- ---------------------------- -ALTER TABLE "config_tags_relation" ADD CONSTRAINT "config_tags_relation_pkey" PRIMARY KEY ("nid"); - --- ---------------------------- --- Indexes structure for table group_capacity --- ---------------------------- -CREATE UNIQUE INDEX "uk_group_id" ON "group_capacity" USING btree ( - "group_id" -); - --- ---------------------------- --- Primary Key structure for table group_capacity --- ---------------------------- -ALTER TABLE "group_capacity" ADD CONSTRAINT "group_capacity_pkey" PRIMARY KEY ("id"); - --- ---------------------------- --- Indexes structure for table his_config_info --- ---------------------------- -CREATE INDEX "idx_did" ON "his_config_info" USING btree ( - "data_id" -); -CREATE INDEX "idx_gmt_create" ON "his_config_info" USING btree ( - "gmt_create" -); -CREATE INDEX "idx_gmt_modified" ON "his_config_info" USING btree ( - "gmt_modified" -); - --- ---------------------------- --- Primary Key structure for table his_config_info --- ---------------------------- -ALTER TABLE "his_config_info" ADD CONSTRAINT "his_config_info_pkey" PRIMARY KEY ("nid"); - --- ---------------------------- --- Indexes structure for table permissions --- ---------------------------- -CREATE UNIQUE INDEX "uk_role_permission" ON "permissions" USING btree ( - "role", - "resource", - "action" -); - --- ---------------------------- --- Indexes structure for table roles --- ---------------------------- -CREATE UNIQUE INDEX "uk_username_role" ON "roles" USING btree ( - "username", - "role" -); - --- ---------------------------- --- Indexes structure for table tenant_capacity --- ---------------------------- -CREATE UNIQUE INDEX "uk_tenant_id" ON "tenant_capacity" USING btree ( - "tenant_id" -); - --- ---------------------------- --- Primary Key structure for table tenant_capacity --- ---------------------------- -ALTER TABLE "tenant_capacity" ADD CONSTRAINT "tenant_capacity_pkey" PRIMARY KEY ("id"); - --- ---------------------------- --- Indexes structure for table tenant_info --- ---------------------------- -CREATE UNIQUE INDEX "uk_tenant_info_kptenantid" ON "tenant_info" USING btree ( - "kp", - "tenant_id" -);