chore: update and move to the new server

This commit is contained in:
2026-03-05 20:12:02 +08:00
parent 0b8ee72285
commit 5a521ea48e
2 changed files with 41 additions and 40 deletions

View File

@@ -1,2 +1,2 @@
# blog-doc
# blog-doc

View File

@@ -1,38 +1,39 @@
CREATE TABLE "articles" (
"id" bigserial,
"title" varchar(50) NOT NULL,
"content" text,
"published" time,
PRIMARY KEY ("id")
);
CREATE TABLE "comments" (
"id" bigserial,
"content" varchar(255) NOT NULL,
"published" time,
"u_id" int4,
"a_id" int4 NOT NULL,
PRIMARY KEY ("id")
);
CREATE TABLE "news" (
"id" bigserial,
"title" varchar(50) NOT NULL,
"content" text,
"published" time,
"related" uuid,
PRIMARY KEY ("id")
);
CREATE TABLE "users" (
"id" bigserial,
"name" varchar(50) NOT NULL,
"profile" varchar(255) NOT NULL DEFAULT https://www.merlin.xin/public/profile,
"account" varchar(255) NOT NULL,
"password" varchar(255) NOT NULL,
PRIMARY KEY ("id")
);
ALTER TABLE "articles" ADD CONSTRAINT "fk_articles_comments_1" FOREIGN KEY ("id") REFERENCES "comments" ("a_id");
ALTER TABLE "users" ADD CONSTRAINT "fk_users_comments_1" FOREIGN KEY ("id") REFERENCES "comments" ("u_id");
CREATE TABLE "articles" (
"id" bigserial,
"title" varchar(50) NOT NULL,
"cover" varchar(255) DEFAULT '{{.Values.web.default.cover}}',
"content" text,
"published" date DEFAULT CURRENT_DATE,
PRIMARY KEY ("id")
);
CREATE TABLE "news" (
"id" bigserial,
"title" varchar(50) NOT NULL,
"cover" varchar(255) DEFAULT '{{.Values.web.default.cover}}',
"content" text,
"published" date DEFAULT CURRENT_DATE,
"related" varchar(255),
PRIMARY KEY ("id")
);
CREATE TABLE "users" (
"id" bigserial,
"name" varchar(50) NOT NULL,
"profile" varchar(255) NOT NULL DEFAULT '{{.Values.web.default.avatar}}',
"account" varchar(255) NOT NULL UNIQUE,
"password" varchar(255) NOT NULL,
"ip" varchar(50),
PRIMARY KEY ("id")
);
CREATE TABLE "comments" (
"id" bigserial,
"content" varchar(255) NOT NULL,
"published" date DEFAULT CURRENT_DATE,
"u_id" int8,
"a_id" int8 NOT NULL,
PRIMARY KEY ("id"),
CONSTRAINT fk_comments_articles FOREIGN KEY ("a_id") REFERENCES "articles" ("id"),
CONSTRAINT fk_comments_users FOREIGN KEY ("u_id") REFERENCES "users" ("id")
);