Skip to content

Instantly share code, notes, and snippets.

@pot-code
Last active April 13, 2021 07:25
Show Gist options
  • Save pot-code/dc59fe348f59475beee0d1dd020ee8a8 to your computer and use it in GitHub Desktop.
Save pot-code/dc59fe348f59475beee0d1dd020ee8a8 to your computer and use it in GitHub Desktop.
[postgres] #pgsql
CREATE TABLE notification (
"id" VARCHAR(32),
"action_type" SMALLINT NOT NULL,
"obj_type" VARCHAR(16) NOT NULL,
"obj" VARCHAR(32) NOT NULL,
"actor" VARCHAR(32) NOT NULL,
"create_at" timestamp DEFAULT (now() at time zone 'utc'),
"updated_at" timestamp DEFAULT (now() at time zone 'utc'),
"status" SMALLINT NOT NULL DEFAULT 1,
PRIMARY KEY ("id"),
CONSTRAINT actor_fk FOREIGN KEY (actor) REFERENCES "user" (id)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment