add MySQL + PG down.sql

This commit is contained in:
Ember Moth
2026-07-05 20:36:25 +08:00
parent 7b3a94308f
commit 67bfc9bd72
78 changed files with 778 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
CREATE TABLE IF NOT EXISTS "server"
(
"id" BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL,
"name" varchar(100) NOT NULL DEFAULT '',
"tags" varchar(128) NOT NULL DEFAULT '',
"country" varchar(128) NOT NULL DEFAULT '',
"city" varchar(128) NOT NULL DEFAULT '',
"latitude" varchar(128) NOT NULL DEFAULT '',
"longitude" varchar(128) NOT NULL DEFAULT '',
"server_addr" varchar(100) NOT NULL DEFAULT '',
"relay_mode" varchar(20) NOT NULL DEFAULT 'none',
"relay_node" text,
"speed_limit" bigint NOT NULL DEFAULT '0',
"traffic_ratio" decimal(4, 2) NOT NULL DEFAULT '0.00',
"group_id" bigint DEFAULT NULL,
"protocol" varchar(20) NOT NULL DEFAULT '',
"config" text,
"enable" SMALLINT NOT NULL DEFAULT '1',
"sort" bigint NOT NULL DEFAULT '0',
"last_reported_at" TIMESTAMP(3) DEFAULT NULL,
"created_at" TIMESTAMP(3) DEFAULT NULL,
"updated_at" TIMESTAMP(3) DEFAULT NULL,
PRIMARY KEY ("id")
);
CREATE INDEX IF NOT EXISTS "server_idx_group_id" ON "server" ("group_id");