1 CREATE USER roomreservation
;
4 -- Table with rooms allowed for booking
6 CREATE TABLE mod_roomreservation_roomswhitelist (
7 rrr_name
TEXT UNIQUE REFERENCES rooms(name)
13 -- Table with bookings
15 CREATE TABLE mod_roomreservation_bookings (
16 rrb_uid SERIAL
NOT NULL PRIMARY KEY, -- Unique ID
17 rrb_room
TEXT NOT NULL -- Name of the room
18 REFERENCES rooms(name)
21 rrb_date
DATE NOT NULL, -- Date of the booking
22 rrb_tsfirst
SMALLINT NOT NULL, -- Number of the first timeslice
23 rrb_tslast
SMALLINT NOT NULL -- Number of the last timeslice
24 CHECK(rrb_tsfirst
<= rrb_tslast
),
25 rrb_act
TEXT NOT NULL -- Owner of the booking
29 rrb_reason
TEXT NOT NULL, -- Reason
30 rrb_interval
SMALLINT NOT NULL -- Interval in weeks for recurring
38 GRANT SELECT, INSERT, UPDATE, DELETE ON mod_roomreservation_bookings
TO
40 GRANT SELECT, UPDATE ON mod_roomreservation_bookings_rrb_uid_seq
TO
42 GRANT SELECT, INSERT, UPDATE, DELETE ON mod_roomreservation_roomswhitelist
TO
44 GRANT INSERT, UPDATE ON log
TO roomreservation
;
45 GRANT SELECT, INSERT, UPDATE ON log_module
TO roomreservation
;
46 GRANT SELECT ON users
TO roomreservation
;
47 GRANT SELECT ON groups
TO roomreservation
;
48 GRANT SELECT ON rooms
TO roomreservation
;
49 GRANT SELECT, INSERT ON privileges_assign
TO roomreservation
;