Index: pykota/trunk/initscripts/ldap/pykota.schema
===================================================================
--- pykota/trunk/initscripts/ldap/pykota.schema (revision 1480)
+++ pykota/trunk/initscripts/ldap/pykota.schema (revision 1520)
@@ -175,4 +175,16 @@
         SUBSTR caseIgnoreSubstringsMatch
         SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
+        
+# pykotaJobSizeBytes
+attributetype ( 1.3.6.1.4.1.16868.1.1.25 NAME 'pykotaJobSizeBytes'
+        DESC 'Current job size in number of bytes in the history'
+        EQUALITY integerMatch
+        SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
+
+# pykotaPayments
+attributetype ( 1.3.6.1.4.1.16868.1.1.26 NAME 'pykotaPayments'
+        DESC 'Stores all payments made by an user, encoded to store both date and amount'
+        EQUALITY caseExactIA5Match
+        SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
 
 #        
@@ -214,10 +226,10 @@
         DESC 'An entry in the job history for a printer'
         MUST ( cn $ pykotaUserName $ pykotaPrinterName $ pykotaJobId )
-        MAY  ( pykotaPrinterPageCounter $ pykotaJobSize $ pykotaAction $ pykotaJobPrice $ pykotaFileName $ pykotaTitle $ pykotaCopies $ pykotaOptions $ pykotaHostName ) )
+        MAY  ( pykotaPrinterPageCounter $ pykotaJobSize $ pykotaAction $ pykotaJobPrice $ pykotaFileName $ pykotaTitle $ pykotaCopies $ pykotaOptions $ pykotaHostName $ pykotaJobSizeBytes ) )
         
 # pykotaAccountBalance
 objectclass ( 1.3.6.1.4.1.16868.1.2.7 NAME 'pykotaAccountBalance' SUP top AUXILIARY
         DESC 'PyKota User account balance'
-        MAY  ( pykotaUserName $ pykotaBalance $ pykotaLifeTimePaid ) )
+        MAY  ( pykotaUserName $ pykotaBalance $ pykotaLifeTimePaid $ pykotaPayments ) )
         
 # pykotaLastJob        
Index: pykota/trunk/initscripts/postgresql/pykota-postgresql.sql
===================================================================
--- pykota/trunk/initscripts/postgresql/pykota-postgresql.sql (revision 1473)
+++ pykota/trunk/initscripts/postgresql/pykota-postgresql.sql (revision 1520)
@@ -20,4 +20,10 @@
 --
 -- $Log$
+-- Revision 1.10  2004/06/03 23:14:09  jalet
+-- Now stores the job's size in bytes in the database.
+-- Preliminary work on payments storage : database schemas are OK now,
+-- but no code to store payments yet.
+-- Removed schema picture, not relevant anymore.
+--
 -- Revision 1.9  2004/05/13 11:15:29  jalet
 -- Added hostname field in job history
@@ -121,6 +127,6 @@
                         userid INT4,
                         printerid INT4,
-                        hostname TEXT,
                         pagecounter INT4 DEFAULT 0,
+                        jobsizebytes INT8,
                         jobsize INT4,
                         jobprice FLOAT,
@@ -130,8 +136,10 @@
                         copies INT4,
                         options TEXT,
+                        hostname TEXT,
                         jobdate TIMESTAMP DEFAULT now(),
                         CONSTRAINT checkUserPQuota FOREIGN KEY (userid, printerid) REFERENCES userpquota(userid, printerid));
 CREATE INDEX jobhistory_p_id_ix ON jobhistory (printerid);
 CREATE INDEX jobhistory_pd_id_ix ON jobhistory (printerid, jobdate);
+CREATE INDEX jobhistory_hostname_ix ON jobhistory (hostname);
                         
 --
@@ -159,13 +167,21 @@
                            printerid INT4 REFERENCES printers(id),
                            PRIMARY KEY (groupid, printerid));
+--
+-- Create the table for payments
+-- 
+CREATE TABLE payments (id SERIAL PRIMARY KEY NOT NULL,
+                       userid INT4 REFERENCES users(id),
+                       amount FLOAT,
+                       date TIMESTAMP DEFAULT now());
+CREATE INDEX payments_date_ix ON payments (date);
 
 --                        
 -- Set some ACLs                        
 --
-REVOKE ALL ON users, groups, printers, userpquota, grouppquota, groupsmembers, printergroupsmembers, jobhistory FROM public;                        
-REVOKE ALL ON users_id_seq, groups_id_seq, printers_id_seq, userpquota_id_seq, grouppquota_id_seq, jobhistory_id_seq FROM public;
+REVOKE ALL ON users, groups, printers, userpquota, grouppquota, groupsmembers, printergroupsmembers, jobhistory, payments FROM public;                        
+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;
 
-GRANT SELECT, INSERT, UPDATE, DELETE, REFERENCES ON users, groups, printers, userpquota, grouppquota, groupsmembers, printergroupsmembers, jobhistory TO pykotaadmin;
-GRANT SELECT, UPDATE ON users_id_seq, groups_id_seq, printers_id_seq, userpquota_id_seq, grouppquota_id_seq, jobhistory_id_seq TO pykotaadmin;
-GRANT SELECT ON users, groups, printers, userpquota, grouppquota, groupsmembers, printergroupsmembers, jobhistory TO pykotauser;
+GRANT SELECT, INSERT, UPDATE, DELETE, REFERENCES ON users, groups, printers, userpquota, grouppquota, groupsmembers, printergroupsmembers, jobhistory, payments TO pykotaadmin;
+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;
+GRANT SELECT ON users, groups, printers, userpquota, grouppquota, groupsmembers, printergroupsmembers, jobhistory, payments TO pykotauser;
 
Index: pykota/trunk/initscripts/postgresql/upgrade-to-1.19.sql
===================================================================
--- pykota/trunk/initscripts/postgresql/upgrade-to-1.19.sql (revision 1473)
+++ pykota/trunk/initscripts/postgresql/upgrade-to-1.19.sql (revision 1520)
@@ -20,4 +20,10 @@
 --
 -- $Log$
+-- Revision 1.2  2004/06/03 23:14:10  jalet
+-- Now stores the job's size in bytes in the database.
+-- Preliminary work on payments storage : database schemas are OK now,
+-- but no code to store payments yet.
+-- Removed schema picture, not relevant anymore.
+--
 -- Revision 1.1  2004/05/13 11:15:29  jalet
 -- Added hostname field in job history
@@ -39,4 +45,17 @@
 -- Modify the old database schema
 --
+ALTER TABLE jobhistory ADD COLUMN jobsizebytes INT8;
 ALTER TABLE jobhistory ADD COLUMN hostname TEXT;
+CREATE INDEX jobhistory_hostname_ix ON jobhistory (hostname);
 
+CREATE TABLE payments (id SERIAL PRIMARY KEY NOT NULL,
+                       userid INT4 REFERENCES users(id),
+                       amount FLOAT,
+                       date TIMESTAMP DEFAULT now());
+CREATE INDEX payments_date_ix ON payments (date);
+
+REVOKE ALL ON payments FROM public;                        
+REVOKE ALL ON payments_id_seq FROM public;
+GRANT SELECT, INSERT, UPDATE, DELETE, REFERENCES ON payments TO pykotaadmin;
+GRANT SELECT, UPDATE ON payments_id_seq TO pykotaadmin;
+GRANT SELECT ON payments TO pykotauser;
