mirror of https://github.com/xfarrow/blink
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:
parent
b03f109590
commit
ad43563c05
|
@ -4,15 +4,14 @@
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS public."Person"
|
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,
|
email character varying(128) COLLATE pg_catalog."default" NOT NULL,
|
||||||
password 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,
|
display_name character varying(128) COLLATE pg_catalog."default" NOT NULL,
|
||||||
date_of_birth date,
|
date_of_birth date,
|
||||||
available boolean,
|
available boolean,
|
||||||
enabled boolean NOT NULL DEFAULT false,
|
enabled boolean NOT NULL DEFAULT false,
|
||||||
place_of_living character varying(128) COLLATE pg_catalog."default",
|
place_of_living character varying(128) COLLATE pg_catalog."default"
|
||||||
CONSTRAINT "Person_pkey" PRIMARY KEY (id)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
TABLESPACE pg_default;
|
TABLESPACE pg_default;
|
||||||
|
|
|
@ -4,9 +4,8 @@
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS public."ActivationLink"
|
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,
|
person_id integer NOT NULL,
|
||||||
CONSTRAINT "ActivationLink_pkey" PRIMARY KEY (identifier),
|
|
||||||
CONSTRAINT "PersonActivationLinkFK" FOREIGN KEY (person_id)
|
CONSTRAINT "PersonActivationLinkFK" FOREIGN KEY (person_id)
|
||||||
REFERENCES public."Person" (id) MATCH SIMPLE
|
REFERENCES public."Person" (id) MATCH SIMPLE
|
||||||
ON UPDATE CASCADE
|
ON UPDATE CASCADE
|
||||||
|
|
|
@ -4,12 +4,11 @@
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS public."Organization"
|
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,
|
name character varying(128) COLLATE pg_catalog."default" NOT NULL,
|
||||||
location character varying COLLATE pg_catalog."default",
|
location character varying COLLATE pg_catalog."default",
|
||||||
description text COLLATE pg_catalog."default",
|
description text COLLATE pg_catalog."default",
|
||||||
is_hiring boolean,
|
is_hiring boolean
|
||||||
CONSTRAINT "Organization_pkey" PRIMARY KEY (id)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
TABLESPACE pg_default;
|
TABLESPACE pg_default;
|
||||||
|
|
|
@ -4,10 +4,9 @@
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS public."OrganizationPost"
|
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,
|
organization_id integer NOT NULL,
|
||||||
content text COLLATE pg_catalog."default" NOT NULL,
|
content text COLLATE pg_catalog."default" NOT NULL,
|
||||||
CONSTRAINT "OrganizationPost_pkey" PRIMARY KEY (id),
|
|
||||||
CONSTRAINT "OrganizationIdFk" FOREIGN KEY (organization_id)
|
CONSTRAINT "OrganizationIdFk" FOREIGN KEY (organization_id)
|
||||||
REFERENCES public."Organization" (id) MATCH SIMPLE
|
REFERENCES public."Organization" (id) MATCH SIMPLE
|
||||||
ON UPDATE CASCADE
|
ON UPDATE CASCADE
|
||||||
|
|
Loading…
Reference in New Issue