... instead of code, to take full advantage of AutoFieldWidget linking,
at least until perm_list.id is replaced wholesale w/ perm_list.code.
Signed-off-by: Bill Erickson <berick@esilibrary.com>
record_format TEXT NOT NULL DEFAULT 'FI',
transmission_format TEXT NOT NULL DEFAULT 'usmarc',
auth BOOL NOT NULL DEFAULT TRUE,
- use_perm TEXT REFERENCES permission.perm_list (code)
+ use_perm INT -- REFERENCES permission.perm_list (id)
);
COMMENT ON TABLE config.z3950_source IS $$
CREATE INDEX by_heading_and_thesaurus ON authority.record_entry (authority.normalize_heading(marc)) WHERE deleted IS FALSE or deleted = FALSE;
CREATE INDEX by_heading ON authority.record_entry (authority.simple_normalize_heading(marc)) WHERE deleted IS FALSE or deleted = FALSE;
+ALTER TABLE config.z3950_source ADD CONSTRAINT use_perm_fkey FOREIGN KEY (use_perm) REFERENCES permission.perm_list (id) ON UPDATE CASCADE ON DELETE RESTRICT DEFERRABLE INITIALLY DEFERRED;
+
COMMIT;
-- check whether patch can be applied
SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
-ALTER TABLE config.z3950_source
- ADD COLUMN use_perm TEXT REFERENCES permission.perm_list (code)
+ALTER TABLE config.z3950_source
+ ADD COLUMN use_perm INT REFERENCES permission.perm_list (id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED;
COMMENT ON COLUMN config.z3950_source.use_perm IS $$
If set, this permission is required for the source to be listed in the staff