]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/sql/Pg/upgrade/0052.schema.asset_copy_location_order.sql
Create new table asset.copy_location_order, and a new permission
[Evergreen.git] / Open-ILS / src / sql / Pg / upgrade / 0052.schema.asset_copy_location_order.sql
1 INSERT INTO config.upgrade_log (version) VALUES ('0052');
2
3 CREATE TABLE asset.copy_location_order
4 (
5         id              SERIAL           PRIMARY KEY,
6         location        INT              NOT NULL
7                                              REFERENCES asset.copy_location
8                                              ON DELETE CASCADE
9                                              DEFERRABLE INITIALLY DEFERRED,
10         org             INT              NOT NULL
11                                              REFERENCES actor.org_unit
12                                              ON DELETE CASCADE
13                                              DEFERRABLE INITIALLY DEFERRED,
14         position        INT              NOT NULL DEFAULT 0,
15         CONSTRAINT acplo_once_per_org UNIQUE ( location, org )
16 );
17
18 INSERT INTO permission.perm_list VALUES
19 (350, 'ADMIN_COPY_LOCATION_ORDER', oils_i18n_gettext(350, 'Allow a user to create/view/update/delete a copy location order', 'ppl', 'description'));
20
21 COMMIT;