Changeset 1994

Show
Ignore:
Timestamp:
12/23/04 19:40:18 (20 years ago)
Author:
jalet
Message:

Added the coefficient table, and many columns to existing tables

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/initscripts/postgresql/pykota-postgresql.sql

    r1556 r1994  
    2020-- 
    2121-- $Log$ 
     22-- Revision 1.12  2004/12/23 18:40:18  jalet 
     23-- Added the coefficient table, and many columns to existing tables 
     24-- 
    2225-- Revision 1.11  2004/06/20 16:15:21  jalet 
    2326-- Added "description" attribute for printers 
     
    9396                   balance FLOAT DEFAULT 0.0, 
    9497                   lifetimepaid FLOAT DEFAULT 0.0, 
    95                    limitby TEXT DEFAULT 'quota'); 
     98                   limitby TEXT DEFAULT 'quota', 
     99                   coefficient FLOAT NOT NULL DEFAULT 1.0); 
    96100                    
    97101-- 
     
    121125                        softlimit INT4, 
    122126                        hardlimit INT4, 
    123                         datelimit TIMESTAMP); 
     127                        datelimit TIMESTAMP, 
     128                        warned INT4 DEFAULT 0); -- not a boolean, will help stats 
    124129CREATE UNIQUE INDEX userpquota_up_id_ix ON userpquota (userid, printerid); 
    125130                         
     
    141146                        options TEXT, 
    142147                        hostname TEXT, 
     148                        md5sum TEXT, 
     149                        pages TEXT, 
    143150                        jobdate TIMESTAMP DEFAULT now(), 
    144151                        CONSTRAINT checkUserPQuota FOREIGN KEY (userid, printerid) REFERENCES userpquota(userid, printerid)); 
     
    180187CREATE INDEX payments_date_ix ON payments (date); 
    181188 
     189--  
     190-- Create the table for coefficients wrt paper sizes and the like 
     191-- 
     192CREATE 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 
    182198--                         
    183199-- Set some ACLs                         
     
    186202REVOKE 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; 
    187203 
    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  
     204GRANT SELECT, INSERT, UPDATE, DELETE, REFERENCES ON users, groups, printers, userpquota, grouppquota, groupsmembers, printergroupsmembers, jobhistory, payments, coefficients TO pykotaadmin; 
     205GRANT 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; 
     206GRANT SELECT ON users, groups, printers, userpquota, grouppquota, groupsmembers, printergroupsmembers, jobhistory, payments, coefficients TO pykotauser; 
     207