drop default for #PFX#_users::code_guar, now is foreign key of #PFX#_users::code...
authorMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Fri, 27 Dec 2013 13:01:34 +0000 (14:01 +0100)
committerMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Fri, 27 Dec 2013 13:01:34 +0000 (14:01 +0100)
sql/sql.d/065-user-guarant-constraint.sql [new file with mode: 0644]

diff --git a/sql/sql.d/065-user-guarant-constraint.sql b/sql/sql.d/065-user-guarant-constraint.sql
new file mode 100644 (file)
index 0000000..423572a
--- /dev/null
@@ -0,0 +1,4 @@
+ALTER TABLE #PFX#users DROP CONSTRAINT #PFX#users_guar_code_fkey;
+ALTER TABLE #PFX#users ADD CONSTRAINT #PFX#users_guar_code_fkey FOREIGN KEY (guar_code) REFERENCES #PFX#users(code) MATCH FULL;
+
+ALTER TABLE #PFX#users ALTER COLUMN guar_code DROP DEFAULT; --MF
\ No newline at end of file