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

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



Revision: 653
          http://svn.sourceforge.net/ledger-smb/?rev=653&view=rev
Author:   einhverfr
Date:     2006-11-17 10:02:49 -0800 (Fri, 17 Nov 2006)

Log Message:
-----------
Moving upgrade script fixes into trunk

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

Modified: trunk/sql/legacy/Pg-upgrade-2.6.17-2.6.18.sql
===================================================================
--- trunk/sql/legacy/Pg-upgrade-2.6.17-2.6.18.sql	2006-11-17 17:56:45 UTC (rev 652)
+++ trunk/sql/legacy/Pg-upgrade-2.6.17-2.6.18.sql	2006-11-17 18:02:49 UTC (rev 653)
@@ -1,3 +1,4 @@
+BEGIN;
 ALTER TABLE chart ADD PRIMARY KEY (id);
 -- linuxpoet:
 -- adding primary key to acc_trans
@@ -285,3 +286,4 @@
 -- end function
 
 UPDATE defaults SET version = '2.6.18';
+COMMIT;

Modified: trunk/sql/legacy/Pg-upgrade-2.6.18-2.6.19.sql
===================================================================
--- trunk/sql/legacy/Pg-upgrade-2.6.18-2.6.19.sql	2006-11-17 17:56:45 UTC (rev 652)
+++ trunk/sql/legacy/Pg-upgrade-2.6.18-2.6.19.sql	2006-11-17 18:02:49 UTC (rev 653)
@@ -12,8 +12,6 @@
 
 ALTER TABLE customertax ADD PRIMARY KEY (customer_id, chart_id);
 
-ALTER TABLE defaults ADD PRIMARY KEY (version);
-
 ALTER TABLE department ADD PRIMARY KEY (id);
 
 ALTER TABLE dpt_trans ADD PRIMARY KEY (trans_id);
@@ -152,18 +150,8 @@
 ALTER TABLE tax ALTER COLUMN taxmodule_id SET NOT NULL;
 
 -- 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);
-
--- comment this out when user db is working:
-ALTER TABLE session ALTER COLUMN user_id DROP NOT NULL;
-
-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,
@@ -188,24 +176,31 @@
                         password varchar(32) check(length(password) = 32),
                         print text,
                         printer text,
+			crypted_password text;
                         role text,
                         sid text,
                         signature text,
                         stylesheet text,
                         tel text,
                         templates text,
+			crypted_password 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;
 
+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);
+
+-- comment this out when user db is working:
+ALTER TABLE session ALTER COLUMN user_id DROP NOT NULL;
+
 -- Admin user --
 BEGIN;
 INSERT INTO users(username) VALUES ('admin');
 INSERT INTO users_conf(id,password) VALUES (currval('users_id_seq'),NULL);
-COMMIT;
 
 -- Functions
 


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