Changeset 2817
- Timestamp:
- 03/29/06 00:03:44 (19 years ago)
- Location:
- pykota/trunk/initscripts
- Files:
-
- 4 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 ============================================================ -
pykota/trunk/initscripts/postgresql/pykota-postgresql.sql
r2622 r2817 35 35 -- 36 36 -- Create the print quota database users 37 -- NOTE: Change the password values to the passwords you would like. 37 38 -- 38 CREATE USER pykota admin;39 CREATE USER pykota user;39 CREATE USER pykotauser WITH UNENCRYPTED PASSWORD 'readonlypw' NOCREATEDB NOCREATEUSER; 40 CREATE USER pykotaadmin WITH UNENCRYPTED PASSWORD 'readwritepw' NOCREATEDB NOCREATEUSER; 40 41 41 42 -- -
pykota/trunk/initscripts/postgresql/README.postgresql
r2622 r2817 30 30 and read the next one. 31 31 32 - edit the pykota-postgresql.sql file and modify the passwords on 33 the 'CREATE USER' lines. 34 32 35 - Launch the psql frontend and connect to the 33 36 database template1 as a PostgreSQL administrator … … 36 39 as user 'root' : 37 40 38 $su - postgres41 # su - postgres 39 42 40 43 you're now user 'postgres', then continue with : 41 44 42 $ psql -h localhost -U postgres template145 $ psql -h localhost -U postgres -f pykota-postgresql.sql template1 43 46 44 - Executes the pykota-postgresql.sql script : 47 - If no error message appears, your PostgreSQL PyKota storage 48 is now ready for use. NB : a lot of NOTICE messages might appear, 49 this is perfectly normal. 50 51 - In ~pykota/pykota.conf, ensure that the following lines 52 are present and unique inside the [global] section : 45 53 46 template1=# \i pykota-postgresql.sql 54 storagebackend : pgstorage 55 storageserver : localhost 56 storagename : pykota 57 storageuser : pykotauser 58 storageuserpw : readonlypw 47 59 48 - Quit the psql frontend : 60 NB : replace 'readonlypw' with the password you chose 61 for user 'pykotauser' when you modified pykota-postgresql.sql 62 63 - In ~pykota/pykotadmin.conf ensure that the following lines 64 are present and unique inside the [global] section : 49 65 50 template1=# \q 66 storageadmin : pykotaadmin 67 storageadminpw : readwritepw 51 68 52 - Your PostgreSQL PyKota storage is now ready53 for use.69 NB : replace 'readwritepw' with the password you chose 70 for user 'pykotaadmin' when you modified pykota-postgresql.sql 54 71 72 - IMPORTANT : if your database is not located on the print server, 73 replace 'localhost' in the lines above with your database server's 74 hostname or IP address. If your database server doesn't listen on 75 its standard port, add the port number at the end of the hostname 76 with a colon to separate the hostname from the port. 77 See pykota/conf/pykota.conf.sample for examples. 78 55 79 ============================================================ 56 80 … … 70 94 instead : 71 95 72 $su - postgres96 # su - postgres 73 97 74 98 You're now user 'postgres', then continue the upgrade by following