Show
Ignore:
Timestamp:
09/27/08 22:02:37 (16 years ago)
Author:
jerome
Message:

Removed unnecessary spaces at EOL.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/initscripts/postgresql/pykota-postgresql.sql

    r3279 r3413  
    77-- the Free Software Foundation, either version 3 of the License, or 
    88-- (at your option) any later version. 
    9 --  
     9-- 
    1010-- This program is distributed in the hope that it will be useful, 
    1111-- but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1212-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1313-- GNU General Public License for more details. 
    14 --  
     14-- 
    1515-- You should have received a copy of the GNU General Public License 
    1616-- along with this program.  If not, see <http://www.gnu.org/licenses/>. 
     
    3535-- Create the print quota database users 
    3636-- NOTE: Change the password values to the passwords you would like. 
    37 --  
     37-- 
    3838CREATE USER pykotauser WITH UNENCRYPTED PASSWORD 'readonlypw' NOCREATEDB NOCREATEUSER; 
    3939CREATE USER pykotaadmin WITH UNENCRYPTED PASSWORD 'readwritepw' NOCREATEDB NOCREATEUSER; 
    4040 
    41 --  
     41-- 
    4242-- Now connect to the new database 
    43 --  
     43-- 
    4444\connect pykota 
    4545 
     
    4949CREATE TABLE users(id SERIAL PRIMARY KEY NOT NULL, 
    5050                   username TEXT UNIQUE NOT NULL, 
    51                    email TEXT,  
     51                   email TEXT, 
    5252                   balance FLOAT DEFAULT 0.0, 
    5353                   lifetimepaid FLOAT DEFAULT 0.0, 
     
    5555                   description TEXT, 
    5656                   overcharge FLOAT NOT NULL DEFAULT 1.0); 
    57                     
     57 
    5858-- 
    5959-- Create the groups table 
     
    6363                    description TEXT, 
    6464                    limitby TEXT DEFAULT 'quota'); 
    65                      
     65 
    6666-- 
    6767-- Create the printers table 
     
    7474                      passthrough BOOLEAN DEFAULT FALSE, 
    7575                      maxjobsize INT4); 
    76                      
     76 
    7777-- 
    7878-- Create the print quota table for users 
     
    8787                        datelimit TIMESTAMP, 
    8888                        maxjobsize INT4, 
    89                         warncount INT4 DEFAULT 0);  
     89                        warncount INT4 DEFAULT 0); 
    9090CREATE INDEX userpquota_u_id_ix ON userpquota (userid); 
    9191CREATE INDEX userpquota_p_id_ix ON userpquota (printerid); 
    9292CREATE UNIQUE INDEX userpquota_up_id_ix ON userpquota (userid, printerid); 
    93                          
     93 
    9494-- 
    9595-- Create the job history table 
     
    120120CREATE INDEX jobhistory_pd_id_ix ON jobhistory (printerid, jobdate); 
    121121CREATE INDEX jobhistory_hostname_ix ON jobhistory (hostname); 
    122                          
     122 
    123123-- 
    124124-- Create the print quota table for groups 
     
    134134CREATE INDEX grouppquota_p_id_ix ON grouppquota (printerid); 
    135135CREATE UNIQUE INDEX grouppquota_up_id_ix ON grouppquota (groupid, printerid); 
    136                          
    137 --                          
     136 
     137-- 
    138138-- Create the groups/members relationship 
    139139-- 
     
    141141                           userid INT4 REFERENCES users(id), 
    142142                           PRIMARY KEY (groupid, userid)); 
    143                             
    144 --                          
     143 
     144-- 
    145145-- Create the printer groups relationship 
    146146-- 
     
    150150-- 
    151151-- Create the table for payments 
    152 --  
     152-- 
    153153CREATE TABLE payments (id SERIAL PRIMARY KEY NOT NULL, 
    154154                       userid INT4 REFERENCES users(id), 
     
    158158CREATE INDEX payments_date_ix ON payments (date); 
    159159 
    160 --  
     160-- 
    161161-- Create the table for coefficients wrt paper sizes and the like 
    162162-- 
    163 CREATE TABLE coefficients (id SERIAL PRIMARY KEY NOT NULL,  
    164                            printerid INTEGER NOT NULL REFERENCES printers(id),  
    165                            label TEXT NOT NULL,  
    166                            coefficient FLOAT DEFAULT 1.0,  
     163CREATE TABLE coefficients (id SERIAL PRIMARY KEY NOT NULL, 
     164                           printerid INTEGER NOT NULL REFERENCES printers(id), 
     165                           label TEXT NOT NULL, 
     166                           coefficient FLOAT DEFAULT 1.0, 
    167167                           CONSTRAINT coeffconstraint UNIQUE (printerid, label)); 
    168168 
    169 --  
     169-- 
    170170-- Create the table for the billing codes 
    171171-- 
     
    176176                           pagecounter INT4 DEFAULT 0); 
    177177 
    178 --                         
    179 -- Set some ACLs                         
     178-- 
     179-- Set some ACLs 
    180180-- 
    181181REVOKE ALL ON users, groups, printers, userpquota, grouppquota, groupsmembers, printergroupsmembers, jobhistory, payments, coefficients, billingcodes FROM public;