Skip to content

Commit

Permalink
[fix]: typos fixed
Browse files Browse the repository at this point in the history
- fixed table name in `CONSTRAINTS`
- deleted unwanted owner transfer
- typo fixed
  • Loading branch information
e11sy committed Nov 29, 2023
1 parent 70d2536 commit 6d71ca1
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions migrations/tenant/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,28 @@ CREATE TABLE IF NOT EXISTS public.teams (
id integer NOT NULL,
user_id integer NOT NULL,
note_id integer NOT NULL,
role integer NOT NULL,
role integer NOT NULL
);

--
-- Name: teams relation_id_pkey; Type: PK CONSTRAINT; Schema: public; Owner: codex
--
ALTER TABLE public.note_relations DROP CONSTRAINT IF EXISTS relation_id_pkey;
ALTER TABLE public.note_relations
ALTER TABLE public.teams DROP CONSTRAINT IF EXISTS relation_id_pkey;
ALTER TABLE public.teams
ADD CONSTRAINT relation_id_pkey PRIMARY KEY (id);

--
-- Name: teams user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codex
--
ALTER TABLE public.note_relations DROP CONSTRAINT IF EXISTS user_id_fkey;
ALTER TABLE public.note_relations
ALTER TABLE public.teams DROP CONSTRAINT IF EXISTS user_id_fkey;
ALTER TABLE public.teams
ADD CONSTRAINT user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id)
ON UPDATE CASCADE ON DELETE CASCADE;

--
-- Name: teams note_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: codex
--
ALTER TABLE public.note_relations DROP CONSTRAINT IF EXISTS note_id_fkey;
ALTER TABLE public.note_relations
ADD CONSTRAINT note_id_fkey FOREIGN KEY (note-id) REFERENCES public.notes(id)
ALTER TABLE public.teams DROP CONSTRAINT IF EXISTS note_id_fkey;
ALTER TABLE public.teams
ADD CONSTRAINT note_id_fkey FOREIGN KEY (note_id) REFERENCES public.notes(id)
ON UPDATE CASCADE ON DELETE CASCADE;

ALTER TABLE public.note_relations OWNER TO codex;

0 comments on commit 6d71ca1

Please sign in to comment.