[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [260] trunk/sql



Revision: 260
          http://svn.sourceforge.net/ledger-smb/?rev=260&view=rev
Author:   linuxpoet
Date:     2006-10-21 11:24:38 -0700 (Sat, 21 Oct 2006)

Log Message:
-----------
Note to Chrish ... Added users table, added users_conf table which is to replace users/username.conf etc... added comments

Modified Paths:
--------------
    trunk/sql/Pg-tables.sql
    trunk/sql/Pg-upgrade-2.6.18-2.6.19.sql

Modified: trunk/sql/Pg-tables.sql
===================================================================
--- trunk/sql/Pg-tables.sql	2006-10-21 18:13:23 UTC (rev 259)
+++ trunk/sql/Pg-tables.sql	2006-10-21 18:24:38 UTC (rev 260)
@@ -568,7 +568,8 @@
 session_id serial PRIMARY KEY,
 sl_login VARCHAR(50),
 token VARCHAR(32) CHECK(length(token) = 32),
-last_used TIMESTAMP default now()
+last_used TIMESTAMP default now(),
+users_id integer not null references users(id),
 );
 
 
@@ -710,3 +711,42 @@
   ) VALUES (
   1, 'Simple'
 );
+
+-- USERS stuff --
+CREATE TABLE users (id serial UNIQUE, username varchar(30) primary key);
+COMMENT ON TABLE users IS 'username is the actual primary key here because we don't want duplicate users';
+CREATE TABLE users_conf(id integer primary key references users(id) deferrable initially deferred,
+                        acs text,
+                        address text,
+                        businessnumber text,
+                        company text,
+                        countrycode text,
+                        currency text,
+                        dateformat text,
+                        dbconnect text,
+                        dbdriver text default 'Pg',
+                        dbhost text default 'localhost',
+                        dbname text,
+                        dboptions text,
+                        dbpasswd text,
+                        dbport text,
+                        dbuser text,
+                        email text,
+                        fax text,
+                        menuwidth text,
+                        name text,
+                        numberformat text,
+                        password varchar(32) check(length(password) = 32),
+                        print text,
+                        printer text,
+                        role text,
+                        sid text,
+                        signature text,
+                        stylesheet text,
+                        tel text,
+                        templates text,
+                        timeout numeric,
+                        vclimit numeric);
+COMMENT ON TABLE users_conf IS 'This is a completely dumb table that is a place holder to get usersconf into the database. Next major release will have a much more sane implementation';
+COMMENT ON COLUMN users_conf.id IS 'Yes primary key with a FOREIGN KEY to users(id) is correct'; 
+COMMENT ON COLUMN users_conf.password IS 'This means we have to get rid of the current password stuff and move to presumably md5()';

Modified: trunk/sql/Pg-upgrade-2.6.18-2.6.19.sql
===================================================================
--- trunk/sql/Pg-upgrade-2.6.18-2.6.19.sql	2006-10-21 18:13:23 UTC (rev 259)
+++ trunk/sql/Pg-upgrade-2.6.18-2.6.19.sql	2006-10-21 18:24:38 UTC (rev 260)
@@ -139,6 +139,52 @@
 UPDATE tax SET taxmodule_id = 1;
 ALTER TABLE tax ALTER COLUMN taxmodule_id SET NOT NULL;
 
--- Fixed session table --
+-- Fixed session table and add users table --
+BEGIN;
+LOCK session in EXCLUSIVE MODE;
 ALTER TABLE session ADD CONSTRAINT session_token_check check (length(token::text) = 32);
+ALTER TABLE session ADD column user_id integer not null references users(id);
+LOCK users in EXCLUSIVE MODE;
+CREATE TABLE users (id serial UNIQUE, username varchar(30) PRIMARY KEY);
+COMMENT ON TABLE users 'username is the primary key because we don't want duplicate users';
+LOCK users_conf in EXCLUSIVE MODE;
+CREATE TABLE users_conf(id integer primary key references users(id) deferrable initially deferred,
+                        acs text,
+                        address text,
+                        businessnumber text,
+                        company text,
+                        countrycode text,
+                        currency text,
+                        dateformat text,
+                        dbconnect text,
+                        dbdriver text default 'Pg',
+                        dbhost text default 'localhost',
+                        dbname text,
+                        dboptions text,
+                        dbpasswd text,
+                        dbport text,
+                        dbuser text,
+                        email text,
+                        fax text,
+                        menuwidth text,
+                        name text,
+                        numberformat text,
+                        password varchar(32) check(length(password) = 32),
+                        print text,
+                        printer text,
+                        role text,
+                        sid text,
+                        signature text,
+                        stylesheet text,
+                        tel text,
+                        templates text,
+                        timeout numeric,
+                        vclimit numeric);
+COMMENT ON TABLE users_conf IS 'This is a completely dumb table that is a place holder to get usersconf into the database. Next major release will have a much more sane implementation';
+COMMENT ON COLUMN users_conf.id IS 'Yes primary key with a FOREIGN KEY to users(id) is correct';
+COMMENT ON COLUMN users_conf.password IS 'This means we have to get rid of the current password stuff and move to presumably md5()';
+COMMIT;
 
+
+
+


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.