install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0057'); -- senator
+INSERT INTO config.upgrade_log (version) VALUES ('0058'); -- miker
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
description TEXT,
datatype TEXT NOT NULL DEFAULT 'string',
fm_class TEXT,
+ view_perm INT,
+ update_perm INT,
--
-- define valid datatypes
--
ALTER TABLE config.billing_type ADD CONSTRAINT config_billing_type_owner_fkey FOREIGN KEY (owner) REFERENCES actor.org_unit (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
+ALTER TABLE config.org_unit_setting_type ADD CONSTRAINT view_perm_fkey FOREIGN KEY (view_perm) REFERENCES permission.perm_list (id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED;
+ALTER TABLE config.org_unit_setting_type ADD CONSTRAINT update_perm_fkey FOREIGN KEY (update_perm) REFERENCES permission.perm_list (id) ON DELETE SET NULL CASCADE DEFERRABLE INITIALLY DEFERRED;
+
COMMIT;
--- /dev/null
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0058'); -- miker
+
+ALTER TABLE config.org_unit_setting_type ADD COLUMN view_perm INT REFERENCES permission.perm_list (id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED;
+ALTER TABLE config.org_unit_setting_type ADD COLUMN update_perm INT REFERENCES permission.perm_list (id) ON DELETE SET NULL CASCADE DEFERRABLE INITIALLY DEFERRED;
+
+COMMIT;
+