Skip to content

Commit

Permalink
Add ON UPDATE / ON DELETE CASCADE clause for the powa_extensions FK.
Browse files Browse the repository at this point in the history
Thanks to Andriy Bartash for the report.
  • Loading branch information
rjuju committed Dec 14, 2020
1 parent d8e9014 commit 59bcbc6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions powa--4.1.1--4.1.2.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
--\echo Use "ALTER EXTENSION powa" to load this file. \quit

ALTER TABLE public.powa_extensions DROP CONSTRAINT powa_extensions_srvid_fkey;
ALTER TABLE public.powa_extensions ADD
FOREIGN KEY (srvid) REFERENCES public.powa_servers (id)
MATCH FULL ON UPDATE CASCADE ON DELETE CASCADE;
1 change: 1 addition & 0 deletions powa--4.1.2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,7 @@ CREATE TABLE public.powa_extensions (
version text,
PRIMARY KEY (srvid, extname),
FOREIGN KEY (srvid) REFERENCES public.powa_servers (id)
MATCH FULL ON UPDATE CASCADE ON DELETE CASCADE
);

INSERT INTO public.powa_extensions(srvid, extname) VALUES
Expand Down

0 comments on commit 59bcbc6

Please sign in to comment.