Changeset 1994
- Timestamp:
- 12/23/04 19:40:18 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/initscripts/postgresql/pykota-postgresql.sql
r1556 r1994 20 20 -- 21 21 -- $Log$ 22 -- Revision 1.12 2004/12/23 18:40:18 jalet 23 -- Added the coefficient table, and many columns to existing tables 24 -- 22 25 -- Revision 1.11 2004/06/20 16:15:21 jalet 23 26 -- Added "description" attribute for printers … … 93 96 balance FLOAT DEFAULT 0.0, 94 97 lifetimepaid FLOAT DEFAULT 0.0, 95 limitby TEXT DEFAULT 'quota'); 98 limitby TEXT DEFAULT 'quota', 99 coefficient FLOAT NOT NULL DEFAULT 1.0); 96 100 97 101 -- … … 121 125 softlimit INT4, 122 126 hardlimit INT4, 123 datelimit TIMESTAMP); 127 datelimit TIMESTAMP, 128 warned INT4 DEFAULT 0); -- not a boolean, will help stats 124 129 CREATE UNIQUE INDEX userpquota_up_id_ix ON userpquota (userid, printerid); 125 130 … … 141 146 options TEXT, 142 147 hostname TEXT, 148 md5sum TEXT, 149 pages TEXT, 143 150 jobdate TIMESTAMP DEFAULT now(), 144 151 CONSTRAINT checkUserPQuota FOREIGN KEY (userid, printerid) REFERENCES userpquota(userid, printerid)); … … 180 187 CREATE INDEX payments_date_ix ON payments (date); 181 188 189 -- 190 -- Create the table for coefficients wrt paper sizes and the like 191 -- 192 CREATE TABLE coefficients (id SERIAL PRIMARY KEY NOT NULL, 193 printerid INTEGER NOT NULL REFERENCES printers(id), 194 label TEXT NOT NULL, 195 coefficient FLOAT NOT NULL DEFAULT 1.0, 196 CONSTRAINT coeffconstraint UNIQUE (printerid, label)); 197 182 198 -- 183 199 -- Set some ACLs … … 186 202 REVOKE ALL ON users_id_seq, groups_id_seq, printers_id_seq, userpquota_id_seq, grouppquota_id_seq, jobhistory_id_seq, payments_id_seq FROM public; 187 203 188 GRANT SELECT, INSERT, UPDATE, DELETE, REFERENCES ON users, groups, printers, userpquota, grouppquota, groupsmembers, printergroupsmembers, jobhistory, payments TO pykotaadmin;189 GRANT SELECT, UPDATE ON users_id_seq, groups_id_seq, printers_id_seq, userpquota_id_seq, grouppquota_id_seq, jobhistory_id_seq, payments_id_seq TO pykotaadmin;190 GRANT SELECT ON users, groups, printers, userpquota, grouppquota, groupsmembers, printergroupsmembers, jobhistory, payments TO pykotauser;191 204 GRANT SELECT, INSERT, UPDATE, DELETE, REFERENCES ON users, groups, printers, userpquota, grouppquota, groupsmembers, printergroupsmembers, jobhistory, payments, coefficients TO pykotaadmin; 205 GRANT SELECT, UPDATE ON users_id_seq, groups_id_seq, printers_id_seq, userpquota_id_seq, grouppquota_id_seq, jobhistory_id_seq, payments_id_seq, coefficients_id_seq TO pykotaadmin; 206 GRANT SELECT ON users, groups, printers, userpquota, grouppquota, groupsmembers, printergroupsmembers, jobhistory, payments, coefficients TO pykotauser; 207