Update SQL

modificato:             backend/sql/1-create_person.sql
	modificato:             backend/sql/2-create_activation_link.sql
	modificato:             backend/sql/3-create_organization.sql
	modificato:             backend/sql/4-create_organization_post.sql
This commit is contained in:
xfarrow 2023-10-12 21:00:51 +02:00
parent b03f109590
commit ad43563c05
4 changed files with 6 additions and 10 deletions

View File

@ -4,15 +4,14 @@
CREATE TABLE IF NOT EXISTS public."Person"
(
id integer NOT NULL DEFAULT nextval('"Person_id_seq"'::regclass),
id SERIAL PRIMARY KEY,
email character varying(128) COLLATE pg_catalog."default" NOT NULL,
password character varying(128) COLLATE pg_catalog."default" NOT NULL,
display_name character varying(128) COLLATE pg_catalog."default" NOT NULL,
date_of_birth date,
available boolean,
enabled boolean NOT NULL DEFAULT false,
place_of_living character varying(128) COLLATE pg_catalog."default",
CONSTRAINT "Person_pkey" PRIMARY KEY (id)
place_of_living character varying(128) COLLATE pg_catalog."default"
)
TABLESPACE pg_default;

View File

@ -4,9 +4,8 @@
CREATE TABLE IF NOT EXISTS public."ActivationLink"
(
identifier character varying COLLATE pg_catalog."default" NOT NULL,
identifier character varying PRIMARY KEY COLLATE pg_catalog."default" ,
person_id integer NOT NULL,
CONSTRAINT "ActivationLink_pkey" PRIMARY KEY (identifier),
CONSTRAINT "PersonActivationLinkFK" FOREIGN KEY (person_id)
REFERENCES public."Person" (id) MATCH SIMPLE
ON UPDATE CASCADE

View File

@ -4,12 +4,11 @@
CREATE TABLE IF NOT EXISTS public."Organization"
(
id integer NOT NULL DEFAULT nextval('"Organization_id_seq"'::regclass),
id SERIAL PRIMARY KEY,
name character varying(128) COLLATE pg_catalog."default" NOT NULL,
location character varying COLLATE pg_catalog."default",
description text COLLATE pg_catalog."default",
is_hiring boolean,
CONSTRAINT "Organization_pkey" PRIMARY KEY (id)
is_hiring boolean
)
TABLESPACE pg_default;

View File

@ -4,10 +4,9 @@
CREATE TABLE IF NOT EXISTS public."OrganizationPost"
(
id integer NOT NULL DEFAULT nextval('"OrganizationPost_id_seq"'::regclass),
id SERIAL PRIMARY KEY,
organization_id integer NOT NULL,
content text COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT "OrganizationPost_pkey" PRIMARY KEY (id),
CONSTRAINT "OrganizationIdFk" FOREIGN KEY (organization_id)
REFERENCES public."Organization" (id) MATCH SIMPLE
ON UPDATE CASCADE