diff --git a/backend/sql/1-create_person.sql b/backend/sql/1-create_person.sql index 8addd66..d655581 100644 --- a/backend/sql/1-create_person.sql +++ b/backend/sql/1-create_person.sql @@ -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; diff --git a/backend/sql/2-create_activation_link.sql b/backend/sql/2-create_activation_link.sql index c766fa1..ad10bd6 100644 --- a/backend/sql/2-create_activation_link.sql +++ b/backend/sql/2-create_activation_link.sql @@ -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 diff --git a/backend/sql/3-create_organization.sql b/backend/sql/3-create_organization.sql index 1bad9da..1a97592 100644 --- a/backend/sql/3-create_organization.sql +++ b/backend/sql/3-create_organization.sql @@ -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; diff --git a/backend/sql/4-create_organization_post.sql b/backend/sql/4-create_organization_post.sql index 475c2a2..bd2f762 100644 --- a/backend/sql/4-create_organization_post.sql +++ b/backend/sql/4-create_organization_post.sql @@ -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