Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #22

Merged
merged 4 commits into from
Jan 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 31 additions & 31 deletions Documents/SCRIPTS_MSSQL.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ ON [operate_log] (
GO
```

# setting
# configuration

```sql
CREATE TABLE [setting] (
CREATE TABLE [configuration] (
[Id] bigint NOT NULL,
[AppId] bigint NOT NULL,
[Environment] varchar(50) NOT NULL,
Expand All @@ -100,33 +100,33 @@ CREATE TABLE [setting] (
)
GO

ALTER TABLE [setting] SET (LOCK_ESCALATION = TABLE)
ALTER TABLE [configuration] SET (LOCK_ESCALATION = TABLE)
GO

CREATE UNIQUE NONCLUSTERED INDEX [IDX_SETTING_UNIQUE]
ON [setting] (
CREATE UNIQUE NONCLUSTERED INDEX [IDX_CONFIG_UNIQUE]
ON [configuration] (
[AppId] ASC,
[Environment] ASC
)
GO

CREATE NONCLUSTERED INDEX [IDX_SETTING_APP_ID]
ON [setting] (
CREATE NONCLUSTERED INDEX [IDX_CONFIG_APP_ID]
ON [configuration] (
[AppId] ASC
)
GO

CREATE NONCLUSTERED INDEX [IDX_SETTING_STATUS]
ON [setting] (
CREATE NONCLUSTERED INDEX [IDX_CONFIG_STATUS]
ON [configuration] (
[Status] ASC
)
GO
```

# setting_archive
# configuration_archive

```sql
CREATE TABLE [setting_archive] (
CREATE TABLE [configuration_archive] (
[Id] bigint NOT NULL,
[AppId] bigint NOT NULL,
[Environment] varchar(50) NOT NULL,
Expand All @@ -137,23 +137,23 @@ CREATE TABLE [setting_archive] (
)
GO

ALTER TABLE [setting_archive] SET (LOCK_ESCALATION = TABLE)
ALTER TABLE [configuration_archive] SET (LOCK_ESCALATION = TABLE)
GO

CREATE UNIQUE NONCLUSTERED INDEX [IDX_SETTING_ARCHIVE_UNIQUE]
ON [setting_archive] (
CREATE UNIQUE NONCLUSTERED INDEX [IDX_CONFIG_ARCHIVE_UNIQUE]
ON [configuration_archive] (
[AppId] ASC,
[Environment] ASC
)
GO
```

# setting_item
# configuration_item

```sql
CREATE TABLE [setting_item] (
CREATE TABLE [configuration_item] (
[Id] bigint NOT NULL,
[SettingId] bigint NOT NULL,
[ConfigurationId] bigint NOT NULL,
[Key] varchar(255) NOT NULL,
[Value] text NULL,
[UpdateTime] datetime DEFAULT getdate() NOT NULL,
Expand All @@ -162,29 +162,29 @@ CREATE TABLE [setting_item] (
)
GO

ALTER TABLE [setting_item] SET (LOCK_ESCALATION = TABLE)
ALTER TABLE [configuration_item] SET (LOCK_ESCALATION = TABLE)
GO

CREATE UNIQUE NONCLUSTERED INDEX [IDX_SETTING_ITEM_UNIQUE]
ON [setting_item] (
[SettingId] ASC,
CREATE UNIQUE NONCLUSTERED INDEX [IDX_CONFIG_ITEM_UNIQUE]
ON [configuration_item] (
[ConfigurationId] ASC,
[Key] ASC
)
GO

CREATE NONCLUSTERED INDEX [IDX_SETTING_ITEM_FK]
ON [setting_item] (
[SettingId] ASC
CREATE NONCLUSTERED INDEX [IDX_CONFIG_ITEM_FK]
ON [configuration_item] (
[ConfigurationId] ASC
)
GO
```

# setting_revision
# configuration_revision

```sql
CREATE TABLE [setting_revision] (
CREATE TABLE [configuration_revision] (
[Id] bigint NOT NULL,
[SettingId] bigint NOT NULL,
[ConfigurationId] bigint NOT NULL,
[Data] text NULL,
[Comment] varchar(1000) COLLATE SQL_Latin1_General_CP1_CI_AS DEFAULT NULL NULL,
[Version] varchar(25) NOT NULL,
Expand All @@ -194,12 +194,12 @@ CREATE TABLE [setting_revision] (
)
GO

ALTER TABLE [setting_revision] SET (LOCK_ESCALATION = TABLE)
ALTER TABLE [configuration_revision] SET (LOCK_ESCALATION = TABLE)
GO

CREATE NONCLUSTERED INDEX [IDS_SETTING_REVISION_FK]
ON [setting_revision] (
[SettingId] ASC
CREATE NONCLUSTERED INDEX [IDS_CONFIG_REVISION_FK]
ON [configuration_revision] (
[ConfigurationId] ASC
)
GO
```
Expand Down
34 changes: 17 additions & 17 deletions Documents/SCRIPTS_MYSQL.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ CREATE TABLE `operate_log` (
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
```

# setting
# configuration

```sql
CREATE TABLE `setting` (
CREATE TABLE `configuration` (
`Id` bigint NOT NULL,
`AppId` bigint NOT NULL,
`Environment` varchar(50) NOT NULL,
Expand All @@ -53,56 +53,56 @@ CREATE TABLE `setting` (
`CreatedBy` varchar(64) NOT NULL,
`UpdatedBy` varchar(64) NOT NULL,
PRIMARY KEY (`Id`) USING BTREE,
UNIQUE INDEX `IDX_SETTING_UNIQUE`(`AppId` ASC, `Environment` ASC) USING BTREE,
INDEX `IDX_SETTING_APP_ID`(`AppId` ASC) USING BTREE,
INDEX `IDX_SETTING_STATUS`(`Status` ASC) USING BTREE
UNIQUE INDEX `IDX_CONFIG_UNIQUE`(`AppId` ASC, `Environment` ASC) USING BTREE,
INDEX `IDX_CONFIG_APP_ID`(`AppId` ASC) USING BTREE,
INDEX `IDX_CONFIG_STATUS`(`Status` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
```

# setting_archive
# configuration_archive

```sql
CREATE TABLE `setting_archive` (
CREATE TABLE `configuration_archive` (
`Id` bigint NOT NULL,
`AppId` bigint NOT NULL,
`Environment` varchar(50) NOT NULL,
`Data` text NULL,
`Operator` varchar(64) NOT NULL,
`ArchiveTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`Id`) USING BTREE,
INDEX `IDX_SETTING_ARCHIVE_UNIQUE`(`AppId` ASC, `Environment` ASC) USING BTREE
INDEX `IDX_CONFIG_ARCHIVE_UNIQUE`(`AppId` ASC, `Environment` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
```

# setting_item
# configuration_item

```sql
CREATE TABLE `setting_item` (
CREATE TABLE `configuration_item` (
`Id` bigint NOT NULL,
`SettingId` bigint NOT NULL,
`ConfigurationId` bigint NOT NULL,
`Key` varchar(255) NOT NULL,
`Value` text NULL,
`UpdateTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`UpdatedBy` varchar(64) NOT NULL,
PRIMARY KEY (`Id`) USING BTREE,
UNIQUE INDEX `IDX_SETTING_ITEM_UNIQUE`(`SettingId` ASC, `Key` ASC) USING BTREE,
INDEX `IDX_SETTING_ITEM_FK`(`SettingId` ASC) USING BTREE
UNIQUE INDEX `IDX_CONFIG_ITEM_UNIQUE`(`ConfigurationId` ASC, `Key` ASC) USING BTREE,
INDEX `IDX_CONFIG_ITEM_FK`(`ConfigurationId` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
```

# setting_revision
# configuration_revision

```sql
CREATE TABLE `setting_revision` (
CREATE TABLE `configuration_revision` (
`Id` bigint NOT NULL,
`SettingId` bigint NOT NULL,
`ConfigurationId` bigint NOT NULL,
`Data` text NULL,
`Comment` varchar(1000) NULL DEFAULT NULL,
`Version` varchar(25) NOT NULL,
`Operator` varchar(64) NOT NULL,
`CreateTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`Id`) USING BTREE,
INDEX `IDS_SETTING_REVISION_FK`(`SettingId` ASC) USING BTREE
INDEX `IDS_CONFIG_REVISION_FK`(`ConfigurationId` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
```

Expand Down
48 changes: 24 additions & 24 deletions Documents/SCRIPTS_PGSQL.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ CREATE INDEX "IDX_OPERATE_LOG_USER_NAME" ON "public"."operate_log" USING btree (
ALTER TABLE "public"."operate_log" ADD CONSTRAINT "operate_log_pkey" PRIMARY KEY ("Id");
```

# setting
# configuration

```sql
CREATE TABLE "public"."setting" (
CREATE TABLE "public"."configuration" (
"Id" int8 NOT NULL,
"AppId" int8 NOT NULL,
"Environment" varchar(25) COLLATE "pg_catalog"."default" NOT NULL,
Expand All @@ -76,24 +76,24 @@ CREATE TABLE "public"."setting" (
)
;

CREATE INDEX "IDX_SETTING_APP_ID" ON "public"."setting" USING btree (
CREATE INDEX "IDX_CONFIG_APP_ID" ON "public"."configuration" USING btree (
"AppId" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "IDX_SETTING_STATUS" ON "public"."setting" USING btree (
CREATE INDEX "IDX_CONFIG_STATUS" ON "public"."configuration" USING btree (
"Status" "pg_catalog"."int4_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "IDX_SETTING_UNIQUE" ON "public"."setting" USING btree (
CREATE UNIQUE INDEX "IDX_CONFIG_UNIQUE" ON "public"."configuration" USING btree (
"AppId" "pg_catalog"."int8_ops" ASC NULLS LAST,
"Environment" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

ALTER TABLE "public"."setting" ADD CONSTRAINT "setting_pkey" PRIMARY KEY ("Id");
ALTER TABLE "public"."configuration" ADD CONSTRAINT "configuration_pkey" PRIMARY KEY ("Id");
```

# setting_archive
# configuration_archive

```sql
CREATE TABLE "public"."setting_archive" (
CREATE TABLE "public"."configuration_archive" (
"Id" int8 NOT NULL,
"AppId" int8 NOT NULL,
"Environment" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
Expand All @@ -103,44 +103,44 @@ CREATE TABLE "public"."setting_archive" (
)
;

CREATE UNIQUE INDEX "IDX_SETTING_ARCHIVE_UNIQUE" ON "public"."setting_archive" USING btree (
CREATE UNIQUE INDEX "IDX_CONFIG_ARCHIVE_UNIQUE" ON "public"."configuration_archive" USING btree (
"AppId" "pg_catalog"."int8_ops" ASC NULLS LAST,
"Environment" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

ALTER TABLE "public"."setting_archive" ADD CONSTRAINT "setting_archive_pkey" PRIMARY KEY ("Id");
ALTER TABLE "public"."configuration_archive" ADD CONSTRAINT "configuration_archive_pkey" PRIMARY KEY ("Id");
```

# setting_item
# configuration_item

```sql
CREATE TABLE "public"."setting_item" (
CREATE TABLE "public"."configuration_item" (
"Id" int8 NOT NULL,
"SettingId" int8 NOT NULL,
"ConfigurationId" int8 NOT NULL,
"Key" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
"Value" text COLLATE "pg_catalog"."default",
"UpdatedTime" timestamp(6) NOT NULL,
"UpdatedBy" varchar(64) COLLATE "pg_catalog"."default" NOT NULL
)
;

CREATE INDEX "IDX_SETTING_ITEM_FK" ON "public"."setting_item" USING btree (
"SettingId" "pg_catalog"."int8_ops" ASC NULLS LAST
CREATE INDEX "IDX_CONFIG_ITEM_FK" ON "public"."configuration_item" USING btree (
"ConfigurationId" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "IDX_SETTING_ITEM_UNIQUE" ON "public"."setting_item" USING btree (
"SettingId" "pg_catalog"."int8_ops" ASC NULLS LAST,
CREATE UNIQUE INDEX "IDX_CONFIG_ITEM_UNIQUE" ON "public"."configuration_item" USING btree (
"ConfigurationId" "pg_catalog"."int8_ops" ASC NULLS LAST,
"Key" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

ALTER TABLE "public"."setting_item" ADD CONSTRAINT "setting_item_pkey" PRIMARY KEY ("Id");
ALTER TABLE "public"."configuration_item" ADD CONSTRAINT "configuration_item_pkey" PRIMARY KEY ("Id");
```

# setting_revision
# configuration_revision

```sql
CREATE TABLE "public"."setting_revision" (
CREATE TABLE "public"."configuration_revision" (
"Id" int8 NOT NULL,
"SettingId" int8 NOT NULL,
"ConfigurationId" int8 NOT NULL,
"Data" text COLLATE "pg_catalog"."default",
"Comment" varchar(1000) COLLATE "pg_catalog"."default",
"Version" varchar(25) COLLATE "pg_catalog"."default" NOT NULL,
Expand All @@ -149,11 +149,11 @@ CREATE TABLE "public"."setting_revision" (
)
;

CREATE INDEX "IDS_SETTING_REVISION_FK" ON "public"."setting_revision" USING btree (
"SettingId" "pg_catalog"."int8_ops" ASC NULLS LAST
CREATE INDEX "IDS_CONFIG_REVISION_FK" ON "public"."configuration_revision" USING btree (
"ConfigurationId" "pg_catalog"."int8_ops" ASC NULLS LAST
);

ALTER TABLE "public"."setting_revision" ADD CONSTRAINT "setting_revision_pkey" PRIMARY KEY ("Id");
ALTER TABLE "public"."configuration_revision" ADD CONSTRAINT "configuration_revision_pkey" PRIMARY KEY ("Id");
```

# team
Expand Down
Loading
Loading