blink/backend/sql/4-create_organization_post.sql

27 lines
804 B
MySQL
Raw Normal View History

2023-10-12 12:23:18 +02:00
-- Table: public.OrganizationPost
-- DROP TABLE IF EXISTS public."OrganizationPost";
CREATE TABLE IF NOT EXISTS public."OrganizationPost"
(
id SERIAL PRIMARY KEY,
2023-10-12 12:23:18 +02:00
organization_id integer NOT NULL,
2024-02-18 12:03:57 +01:00
content text NOT NULL,
created_at timestamp without time zone DEFAULT now(),
original_author integer NOT NULL,
CONSTRAINT "AuthorIdFK" FOREIGN KEY (original_author)
REFERENCES public."Person" (id) MATCH SIMPLE
ON UPDATE NO ACTION
2024-02-16 21:28:10 +01:00
ON DELETE CASCADE
NOT VALID,
2023-10-12 12:23:18 +02:00
CONSTRAINT "OrganizationIdFk" FOREIGN KEY (organization_id)
REFERENCES public."Organization" (id) MATCH SIMPLE
ON UPDATE CASCADE
ON DELETE CASCADE
NOT VALID
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS public."OrganizationPost"
OWNER to postgres;