Changeset 2817 for pykota/trunk/initscripts/mysql
- Timestamp:
- 03/29/06 00:03:44 (18 years ago)
- Location:
- pykota/trunk/initscripts/mysql
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/initscripts/mysql/pykota-mysql.sql
r2695 r2817 35 35 -- 36 36 -- Create the print quota database users 37 -- NOTE: Change the "IDENTIFIED BY" string to the passwordyou would like.37 -- NOTE: Change the "IDENTIFIED BY" strings to the passwords you would like. 38 38 -- 39 39 GRANT USAGE ON *.* TO 'pykotauser'@'localhost' IDENTIFIED BY 'readonlypw'; … … 54 54 lifetimepaid FLOAT DEFAULT 0.0, 55 55 limitby VARCHAR(30) DEFAULT 'quota', 56 57 56 description TEXT, 57 overcharge FLOAT NOT NULL DEFAULT 1.0) TYPE=INNODB; 58 58 59 59 -- … … 62 62 CREATE TABLE groups (id INT4 PRIMARY KEY NOT NULL AUTO_INCREMENT, 63 63 groupname VARCHAR(255) UNIQUE NOT NULL, 64 64 description TEXT, 65 65 limitby VARCHAR(30) DEFAULT 'quota') TYPE=INNODB; 66 66 … … 73 73 priceperpage FLOAT DEFAULT 0.0, 74 74 priceperjob FLOAT DEFAULT 0.0, 75 76 75 passthrough ENUM('t','f') DEFAULT 'f', 76 maxjobsize INT4) TYPE=INNODB; 77 77 78 78 -- … … 87 87 hardlimit INT4, 88 88 datelimit TIMESTAMP, 89 89 maxjobsize INT4, 90 90 warncount INT4 DEFAULT 0, 91 92 93 91 FOREIGN KEY (userid) REFERENCES users(id), 92 FOREIGN KEY (printerid) REFERENCES printers(id)) 93 TYPE=INNODB; 94 94 CREATE INDEX userpquota_u_id_ix ON userpquota (userid); 95 95 CREATE INDEX userpquota_p_id_ix ON userpquota (printerid); … … 113 113 options TEXT, 114 114 hostname VARCHAR(255), 115 116 117 118 119 115 md5sum TEXT, 116 pages TEXT, 117 billingcode TEXT, 118 precomputedjobsize INT4, 119 precomputedjobprice FLOAT, 120 120 jobdate TIMESTAMP DEFAULT now(), 121 121 CONSTRAINT checkUserPQuota FOREIGN KEY (userid, printerid) REFERENCES userpquota (userid, printerid) 122 122 ) TYPE=INNODB; 123 123 CREATE INDEX jobhistory_u_id_ix ON jobhistory (userid); 124 124 CREATE INDEX jobhistory_p_id_ix ON jobhistory (printerid); … … 134 134 softlimit INT4, 135 135 hardlimit INT4, 136 136 maxjobsize INT4, 137 137 datelimit TIMESTAMP, 138 139 140 138 FOREIGN KEY (groupid) REFERENCES groups(id), 139 FOREIGN KEY (printerid) REFERENCES printers(id)) 140 TYPE=INNODB; 141 141 CREATE INDEX grouppquota_g_id_ix ON grouppquota (groupid); 142 142 CREATE INDEX grouppquota_p_id_ix ON grouppquota (printerid); … … 148 148 CREATE TABLE groupsmembers(groupid INT4, 149 149 userid INT4, 150 151 150 FOREIGN KEY (groupid) REFERENCES groups(id), 151 FOREIGN KEY (userid) REFERENCES users(id), 152 152 PRIMARY KEY (groupid, userid)) TYPE=INNODB; 153 153 … … 157 157 CREATE TABLE printergroupsmembers(groupid INT4, 158 158 printerid INT4, 159 160 159 FOREIGN KEY (groupid) REFERENCES groups(id), 160 FOREIGN KEY (printerid) REFERENCES printers(id), 161 161 PRIMARY KEY (groupid, printerid)) TYPE=INNODB; 162 162 -- … … 166 166 userid INT4, 167 167 amount FLOAT, 168 168 description TEXT, 169 169 date TIMESTAMP DEFAULT now(), 170 170 FOREIGN KEY (userid) REFERENCES users(id)) TYPE=INNODB; 171 171 CREATE INDEX payments_date_ix ON payments (date); 172 172 … … 175 175 -- 176 176 CREATE TABLE coefficients (id INT4 PRIMARY KEY NOT NULL AUTO_INCREMENT, 177 178 179 180 181 182 177 printerid INT4 NOT NULL, 178 label VARCHAR(255) NOT NULL, 179 coefficient FLOAT DEFAULT 1.0, 180 FOREIGN KEY (printerid) REFERENCES printers(id), 181 CONSTRAINT coeffconstraint UNIQUE (printerid, label) 182 ) TYPE=INNODB; 183 183 184 184 -- -
pykota/trunk/initscripts/mysql/README.mysql
r2816 r2817 57 57 NB : replace 'readwritepw' with the password you chose 58 58 for user 'pykotaadmin' when you modified pykota-mysql.sql 59 60 - IMPORTANT : if your database is not located on the print server, 61 replace 'localhost' in the lines above with your database server's 62 hostname or IP address. If your database server doesn't listen on 63 its standard port, add the port number at the end of the hostname 64 with a colon to separate the hostname from the port. 65 See pykota/conf/pykota.conf.sample for examples. 59 66 60 67 ============================================================