LP1786524: Table creation fix for new DB user/sandbergja/patron-load-testing
authorblake <blake@mobiusconsortium.org>
Fri, 11 Mar 2022 20:47:19 +0000 (14:47 -0600)
committerJane Sandberg <sandbergja@gmail.com>
Tue, 29 Mar 2022 01:41:25 +0000 (18:41 -0700)
Signed-off-by: blake <blake@mobiusconsortium.org>
Signed-off-by: Jane Sandberg <sandbergja@gmail.com>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/005.schema.actors.sql

index 0a355a6..082d0c4 100644 (file)
@@ -1402,19 +1402,17 @@ CREATE TABLE config.ui_staff_portal_page_entry (
 
 CREATE TABLE config.patron_loader_header_map (
     id SERIAL,
-    org_unit INTEGER NOT NULL,
+    org_unit INTEGER NOT NULL, -- REFERENCES actor.org_unit (id) DEFERRABLE INITIALLY DEFERRED;
     import_header TEXT NOT NULL,
     default_header TEXT NOT NULL
 );
-ALTER TABLE config.patron_loader_header_map ADD CONSTRAINT config_patron_loader_header_map_org_fkey FOREIGN KEY (org_unit) REFERENCES actor.org_unit (id) DEFERRABLE INITIALLY DEFERRED;
 
 CREATE TABLE config.patron_loader_value_map (
     id SERIAL,
-    org_unit INTEGER NOT NULL,
+    org_unit INTEGER NOT NULL,  -- REFERENCES actor.org_unit (id) DEFERRABLE INITIALLY DEFERRED;
     mapping_type TEXT NOT NULL,
     import_value TEXT NOT NULL,
     native_value TEXT NOT NULL
 );
-ALTER TABLE config.patron_loader_value_map ADD CONSTRAINT config_patron_loader_value_map_org_fkey FOREIGN KEY (org_unit) REFERENCES actor.org_unit (id) DEFERRABLE INITIALLY DEFERRED;
 
 COMMIT;
index 0dc997d..cdb20c8 100644 (file)
@@ -1319,5 +1319,7 @@ CREATE TABLE actor.patron_loader_log (
     logtime TIMESTAMP DEFAULT NOW()
 );
 ALTER TABLE actor.patron_loader_log ADD CONSTRAINT actor_patron_loader_log_org_fkey FOREIGN KEY (org_unit) REFERENCES actor.org_unit (id) DEFERRABLE INITIALLY DEFERRED;
+ALTER TABLE config.patron_loader_header_map ADD CONSTRAINT config_patron_loader_header_map_org_fkey FOREIGN KEY (org_unit) REFERENCES actor.org_unit (id) DEFERRABLE INITIALLY DEFERRED;
+ALTER TABLE config.patron_loader_value_map ADD CONSTRAINT config_patron_loader_value_map_org_fkey FOREIGN KEY (org_unit) REFERENCES actor.org_unit (id) DEFERRABLE INITIALLY DEFERRED;
 
 COMMIT;