Changeset 3413 for pykota/trunk/initscripts/sqlite/pykota-sqlite.sql
- Timestamp:
- 09/27/08 22:02:37 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/initscripts/sqlite/pykota-sqlite.sql
r3279 r3413 7 7 -- the Free Software Foundation, either version 3 of the License, or 8 8 -- (at your option) any later version. 9 -- 9 -- 10 10 -- This program is distributed in the hope that it will be useful, 11 11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of 12 12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 13 -- GNU General Public License for more details. 14 -- 14 -- 15 15 -- You should have received a copy of the GNU General Public License 16 16 -- along with this program. If not, see <http://www.gnu.org/licenses/>. … … 32 32 CREATE TABLE users(id INTEGER PRIMARY KEY NOT NULL, 33 33 username TEXT UNIQUE NOT NULL, 34 email TEXT, 34 email TEXT, 35 35 balance FLOAT DEFAULT 0.0, 36 36 lifetimepaid FLOAT DEFAULT 0.0, … … 38 38 description TEXT, 39 39 overcharge FLOAT NOT NULL DEFAULT 1.0); 40 40 41 41 -- 42 42 -- Create the groups table … … 46 46 description TEXT, 47 47 limitby TEXT DEFAULT 'quota'); 48 48 49 49 -- 50 50 -- Create the printers table … … 57 57 passthrough BOOLEAN DEFAULT FALSE, 58 58 maxjobsize INT4); 59 59 60 60 -- 61 61 -- Create the print quota table for users … … 70 70 datelimit TEXT, 71 71 maxjobsize INT4, 72 warncount INT4 DEFAULT 0); 72 warncount INT4 DEFAULT 0); 73 73 CREATE INDEX userpquota_u_id_ix ON userpquota (userid); 74 74 CREATE INDEX userpquota_p_id_ix ON userpquota (printerid); 75 75 CREATE UNIQUE INDEX userpquota_up_id_ix ON userpquota (userid, printerid); 76 76 77 77 -- 78 78 -- Create the job history table … … 103 103 CREATE INDEX jobhistory_pd_id_ix ON jobhistory (printerid, jobdate); 104 104 CREATE INDEX jobhistory_hostname_ix ON jobhistory (hostname); 105 105 106 106 -- 107 107 -- Create the print quota table for groups … … 117 117 CREATE INDEX grouppquota_p_id_ix ON grouppquota (printerid); 118 118 CREATE UNIQUE INDEX grouppquota_up_id_ix ON grouppquota (groupid, printerid); 119 120 -- 119 120 -- 121 121 -- Create the groups/members relationship 122 122 -- … … 124 124 userid INT4 REFERENCES users(id), 125 125 PRIMARY KEY (groupid, userid)); 126 127 -- 126 127 -- 128 128 -- Create the printer groups relationship 129 129 -- … … 133 133 -- 134 134 -- Create the table for payments 135 -- 135 -- 136 136 CREATE TABLE payments (id INTEGER PRIMARY KEY NOT NULL, 137 137 userid INT4 REFERENCES users(id), … … 141 141 CREATE INDEX payments_date_ix ON payments (date); 142 142 143 -- 143 -- 144 144 -- Create the table for coefficients wrt paper sizes and the like 145 145 -- 146 CREATE TABLE coefficients (id INTEGER PRIMARY KEY NOT NULL, 147 printerid INTEGER NOT NULL REFERENCES printers(id), 148 label TEXT NOT NULL, 149 coefficient FLOAT DEFAULT 1.0, 146 CREATE TABLE coefficients (id INTEGER PRIMARY KEY NOT NULL, 147 printerid INTEGER NOT NULL REFERENCES printers(id), 148 label TEXT NOT NULL, 149 coefficient FLOAT DEFAULT 1.0, 150 150 CONSTRAINT coeffconstraint UNIQUE (printerid, label)); 151 151 152 -- 152 -- 153 153 -- Create the table for the billing codes 154 154 --