mirror of
https://github.com/certd/certd.git
synced 2025-11-25 09:10:11 +08:00
chore: 数据库同步
This commit is contained in:
@@ -32,10 +32,10 @@
|
||||
"@aws-sdk/s3-request-presigner": "^3.535.0",
|
||||
"@certd/vue-js-cron-light": "^4.0.14",
|
||||
"@ctrl/tinycolor": "^4.1.0",
|
||||
"@fast-crud/fast-crud": "^1.25.13",
|
||||
"@fast-crud/fast-extends": "^1.25.13",
|
||||
"@fast-crud/ui-antdv4": "^1.25.13",
|
||||
"@fast-crud/ui-interface": "^1.25.13",
|
||||
"@fast-crud/fast-crud": "^1.26.6",
|
||||
"@fast-crud/fast-extends": "^1.26.6",
|
||||
"@fast-crud/ui-antdv4": "^1.26.6",
|
||||
"@fast-crud/ui-interface": "^1.26.6",
|
||||
"@iconify/tailwind": "^1.2.0",
|
||||
"@iconify/vue": "^4.1.1",
|
||||
"@manypkg/get-packages": "^2.2.2",
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE cd_cert_info ADD COLUMN effective_time bigint;
|
||||
ALTER TABLE cd_site_info ADD COLUMN cert_effective_time bigint;
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
CREATE TABLE `cd_addon` (
|
||||
`id` bigint PRIMARY KEY AUTO_INCREMENT NOT NULL,
|
||||
`user_id` bigint NOT NULL,
|
||||
`name` varchar(100) NOT NULL,
|
||||
`type` varchar(100) NOT NULL,
|
||||
`addon_type` varchar(100) NOT NULL,
|
||||
`is_default` boolean NOT NULL DEFAULT false,
|
||||
`is_system` boolean NOT NULL DEFAULT false,
|
||||
`setting` longtext,
|
||||
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE cd_cert_info ADD COLUMN effective_time bigint;
|
||||
ALTER TABLE cd_site_info ADD COLUMN cert_effective_time bigint;
|
||||
13
packages/ui/certd-server/db/migration-pg/v10030__addon.sql
Normal file
13
packages/ui/certd-server/db/migration-pg/v10030__addon.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
CREATE TABLE "cd_addon" (
|
||||
"id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY NOT NULL,
|
||||
"user_id" bigint NOT NULL,
|
||||
"name" varchar(100) NOT NULL,
|
||||
"type" varchar(100) NOT NULL,
|
||||
"addon_type" varchar(100) NOT NULL,
|
||||
"is_default" boolean NOT NULL DEFAULT (false),
|
||||
"is_system" boolean NOT NULL DEFAULT (false),
|
||||
"setting" text,
|
||||
"create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP),
|
||||
"update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP)
|
||||
);
|
||||
@@ -39,6 +39,7 @@ function transformPG() {
|
||||
pgSql = pgSql.replaceAll(/boolean DEFAULT \(0\)/g, 'boolean DEFAULT (false)');
|
||||
pgSql = pgSql.replaceAll(/boolean.*NOT NULL DEFAULT \(0\)/g, 'boolean NOT NULL DEFAULT (false)');
|
||||
pgSql = pgSql.replaceAll(/integer/g, 'bigint');
|
||||
pgSql = pgSql.replaceAll(/INTEGER/g, 'bigint');
|
||||
pgSql = pgSql.replaceAll(/last_insert_rowid\(\)/g, 'LASTVAL()');
|
||||
fs.writeFileSync(`./migration-pg/${notFile}`, pgSql);
|
||||
}
|
||||
@@ -66,6 +67,7 @@ function transformMysql() {
|
||||
//DEFAULT (xxx) 替换成 DEFAULT xxx
|
||||
pgSql = pgSql.replaceAll(/DEFAULT \(([^)]*)\)/g, 'DEFAULT $1');
|
||||
pgSql = pgSql.replaceAll(/integer/g, 'bigint');
|
||||
pgSql = pgSql.replaceAll(/INTEGER/g, 'bigint');
|
||||
pgSql = pgSql.replaceAll(/last_insert_rowid\(\)/g, 'LAST_INSERT_ID()');
|
||||
//text 改成longtext
|
||||
pgSql = pgSql.replaceAll(/text/g, 'longtext');
|
||||
|
||||
Reference in New Issue
Block a user