Refactor interests table: replace with servizio_interessi and update constraints
This commit is contained in:
parent
8725055fb3
commit
1c3e682515
1 changed files with 18 additions and 18 deletions
|
|
@ -390,18 +390,6 @@ CREATE TABLE public.flags (
|
|||
|
||||
ALTER TABLE public.flags OWNER TO postgres;
|
||||
|
||||
--
|
||||
-- Name: interests; Type: TABLE; Schema: public; Owner: postgres
|
||||
--
|
||||
|
||||
CREATE TABLE public.interests (
|
||||
"annuncioId" integer NOT NULL,
|
||||
"userId" uuid NOT NULL
|
||||
);
|
||||
|
||||
|
||||
ALTER TABLE public.interests OWNER TO postgres;
|
||||
|
||||
--
|
||||
-- Name: messages; Type: TABLE; Schema: public; Owner: postgres
|
||||
--
|
||||
|
|
@ -571,6 +559,18 @@ CREATE TABLE public.servizio_annunci (
|
|||
|
||||
ALTER TABLE public.servizio_annunci OWNER TO postgres;
|
||||
|
||||
--
|
||||
-- Name: servizio_interessi; Type: TABLE; Schema: public; Owner: postgres
|
||||
--
|
||||
|
||||
CREATE TABLE public.servizio_interessi (
|
||||
"annuncioId" integer NOT NULL,
|
||||
"userId" uuid NOT NULL
|
||||
);
|
||||
|
||||
|
||||
ALTER TABLE public.servizio_interessi OWNER TO postgres;
|
||||
|
||||
--
|
||||
-- Name: storageindex; Type: TABLE; Schema: public; Owner: postgres
|
||||
--
|
||||
|
|
@ -892,10 +892,10 @@ ALTER TABLE ONLY public.servizio_annunci
|
|||
|
||||
|
||||
--
|
||||
-- Name: interests uniqui_interest; Type: CONSTRAINT; Schema: public; Owner: postgres
|
||||
-- Name: servizio_interessi uniqui_interest; Type: CONSTRAINT; Schema: public; Owner: postgres
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public.interests
|
||||
ALTER TABLE ONLY public.servizio_interessi
|
||||
ADD CONSTRAINT uniqui_interest UNIQUE ("annuncioId", "userId");
|
||||
|
||||
|
||||
|
|
@ -970,18 +970,18 @@ ALTER TABLE ONLY public.chats_etichette
|
|||
|
||||
|
||||
--
|
||||
-- Name: interests interesse_annuncio; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
||||
-- Name: servizio_interessi interesse_annuncio; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public.interests
|
||||
ALTER TABLE ONLY public.servizio_interessi
|
||||
ADD CONSTRAINT interesse_annuncio FOREIGN KEY ("annuncioId") REFERENCES public.annunci(id) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID;
|
||||
|
||||
|
||||
--
|
||||
-- Name: interests interesse_user; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
||||
-- Name: servizio_interessi interesse_user; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public.interests
|
||||
ALTER TABLE ONLY public.servizio_interessi
|
||||
ADD CONSTRAINT interesse_user FOREIGN KEY ("userId") REFERENCES public.users(id) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID;
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue