Changeset 2866
- Timestamp:
- 04/13/06 22:00:57 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/initscripts/mysql/pykota-mysql.sql
r2817 r2866 89 89 maxjobsize INT4, 90 90 warncount INT4 DEFAULT 0, 91 INDEX (userid), 91 92 FOREIGN KEY (userid) REFERENCES users(id), 93 INDEX (printerid), 92 94 FOREIGN KEY (printerid) REFERENCES printers(id)) 93 95 TYPE=INNODB; 94 CREATE INDEX userpquota_u_id_ix ON userpquota (userid);95 CREATE INDEX userpquota_p_id_ix ON userpquota (printerid);96 96 CREATE UNIQUE INDEX userpquota_up_id_ix ON userpquota (userid, printerid); 97 97 … … 118 118 precomputedjobsize INT4, 119 119 precomputedjobprice FLOAT, 120 jobdate TIMESTAMP DEFAULT now(), 121 CONSTRAINT checkUserPQuota FOREIGN KEY (userid, printerid) REFERENCES userpquota (userid, printerid) 120 jobdate TIMESTAMP, 121 INDEX (userid, printerid), 122 CONSTRAINT checkUserPQuota FOREIGN KEY (userid, printerid) REFERENCES userpquota (userid, printerid) 122 123 ) TYPE=INNODB; 123 124 CREATE INDEX jobhistory_u_id_ix ON jobhistory (userid); … … 136 137 maxjobsize INT4, 137 138 datelimit TIMESTAMP, 139 INDEX (groupid), 138 140 FOREIGN KEY (groupid) REFERENCES groups(id), 141 INDEX (printerid), 139 142 FOREIGN KEY (printerid) REFERENCES printers(id)) 140 143 TYPE=INNODB; 141 CREATE INDEX grouppquota_g_id_ix ON grouppquota (groupid);142 CREATE INDEX grouppquota_p_id_ix ON grouppquota (printerid);143 144 CREATE UNIQUE INDEX grouppquota_up_id_ix ON grouppquota (groupid, printerid); 144 145 … … 146 147 -- Create the groups/members relationship 147 148 -- 148 CREATE TABLE groupsmembers(groupid INT4, 149 userid INT4, 149 CREATE TABLE groupsmembers(groupid INT4 NOT NULL, 150 userid INT4 NOT NULL, 151 INDEX (groupid), 150 152 FOREIGN KEY (groupid) REFERENCES groups(id), 153 INDEX (userid), 151 154 FOREIGN KEY (userid) REFERENCES users(id), 152 155 PRIMARY KEY (groupid, userid)) TYPE=INNODB; … … 155 158 -- Create the printer groups relationship 156 159 -- 157 CREATE TABLE printergroupsmembers(groupid INT4, 158 printerid INT4, 160 CREATE TABLE printergroupsmembers(groupid INT4 NOT NULL, 161 printerid INT4 NOT NULL, 162 INDEX (groupid), 159 163 FOREIGN KEY (groupid) REFERENCES groups(id), 164 INDEX (printerid), 160 165 FOREIGN KEY (printerid) REFERENCES printers(id), 161 166 PRIMARY KEY (groupid, printerid)) TYPE=INNODB; … … 167 172 amount FLOAT, 168 173 description TEXT, 169 date TIMESTAMP DEFAULT now(), 174 date TIMESTAMP, 175 INDEX (userid), 170 176 FOREIGN KEY (userid) REFERENCES users(id)) TYPE=INNODB; 171 177 CREATE INDEX payments_date_ix ON payments (date); … … 178 184 label VARCHAR(255) NOT NULL, 179 185 coefficient FLOAT DEFAULT 1.0, 186 INDEX (printerid), 180 187 FOREIGN KEY (printerid) REFERENCES printers(id), 181 188 CONSTRAINT coeffconstraint UNIQUE (printerid, label)