-
-
Notifications
You must be signed in to change notification settings - Fork 551
Description
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");