3 SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
5 CREATE TABLE config.carousel_type (
8 automatic BOOLEAN NOT NULL DEFAULT TRUE,
9 filter_by_age BOOLEAN NOT NULL DEFAULT FALSE,
10 filter_by_copy_owning_lib BOOLEAN NOT NULL DEFAULT FALSE,
11 filter_by_copy_location BOOLEAN NOT NULL DEFAULT FALSE
14 INSERT INTO config.carousel_type
15 (id, name, automatic, filter_by_age, filter_by_copy_owning_lib, filter_by_copy_location)
17 (1, 'Manual', FALSE, FALSE, FALSE, FALSE),
18 (2, 'Newly Catalogued Items', TRUE, TRUE, TRUE, TRUE),
19 (3, 'Recently Returned Items', TRUE, TRUE, TRUE, TRUE),
20 (4, 'Top Circulated Items', TRUE, TRUE, TRUE, FALSE),
21 (5, 'Newest Items By Shelving Location', TRUE, TRUE, TRUE, FALSE)
24 SELECT SETVAL('config.carousel_type_id_seq'::TEXT, 100);
26 CREATE TABLE container.carousel (
27 id SERIAL PRIMARY KEY,
28 type INTEGER NOT NULL REFERENCES config.carousel_type (id),
29 owner INTEGER NOT NULL REFERENCES actor.org_unit (id),
31 bucket INTEGER REFERENCES container.biblio_record_entry_bucket (id),
32 creator INTEGER NOT NULL REFERENCES actor.usr (id),
33 editor INTEGER NOT NULL REFERENCES actor.usr (id),
34 create_time TIMESTAMPTZ NOT NULL DEFAULT now(),
35 edit_time TIMESTAMPTZ NOT NULL DEFAULT now(),
37 owning_lib_filter INT[],
38 copy_location_filter INT[],
39 last_refresh_time TIMESTAMPTZ,
40 active BOOLEAN NOT NULL DEFAULT TRUE,
41 max_items INTEGER NOT NULL
44 CREATE TABLE container.carousel_org_unit (
45 id SERIAL PRIMARY KEY,
46 carousel INTEGER NOT NULL REFERENCES container.carousel (id) ON DELETE CASCADE,
48 org_unit INTEGER NOT NULL REFERENCES actor.org_unit (id),
52 INSERT INTO container.biblio_record_entry_bucket_type (code, label) VALUES ('carousel', 'Carousel');
54 INSERT INTO permission.perm_list ( id, code, description ) VALUES
55 ( 612, 'ADMIN_CAROUSEL_TYPE', oils_i18n_gettext(611,
56 'Allow a user to manage carousel types', 'ppl', 'description')),
57 ( 613, 'ADMIN_CAROUSEL', oils_i18n_gettext(612,
58 'Allow a user to manage carousels', 'ppl', 'description')),
59 ( 614, 'REFRESH_CAROUSEL', oils_i18n_gettext(613,
60 'Allow a user to refresh carousels', 'ppl', 'description'))