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

建表语句貌似需要更换了17的版本 #57

Open
fusss9 opened this issue Jan 14, 2025 · 0 comments
Open

建表语句貌似需要更换了17的版本 #57

fusss9 opened this issue Jan 14, 2025 · 0 comments

Comments

@fusss9
Copy link

fusss9 commented Jan 14, 2025

CREATE TABLE IF NOT EXISTS "comments" (
"id" serial PRIMARY KEY NOT NULL,
"user_id" varchar(200) NOT NULL,
"user_info" json,
"post_id" varchar(100) NOT NULL,
"parent_id" integer REFERENCES "comments"("id"),
"body" json,
"created_at" timestamp DEFAULT now(),
"updated_at" timestamp DEFAULT now()
);

CREATE TABLE IF NOT EXISTS "guestbook" (
"id" serial PRIMARY KEY NOT NULL,
"user_id" varchar(200) NOT NULL,
"user_info" json,
"message" text NOT NULL,
"created_at" timestamp DEFAULT now(),
"updated_at" timestamp DEFAULT now()
);

CREATE TABLE IF NOT EXISTS "newsletters" (
"id" serial PRIMARY KEY NOT NULL,
"subject" varchar(200),
"body" text,
"sent_at" timestamp,
"created_at" timestamp DEFAULT now(),
"updated_at" timestamp DEFAULT now()
);

CREATE TABLE IF NOT EXISTS "subscribers" (
"id" serial PRIMARY KEY NOT NULL,
"email" varchar(120),
"token" varchar(50),
"subscribed_at" timestamp,
"unsubscribed_at" timestamp,
"updated_at" timestamp DEFAULT now()
);

CREATE INDEX IF NOT EXISTS "post_idx" ON "comments" ("post_id");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant