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

SF.net SVN: ledger-smb:[5401] branches/1.3



Revision: 5401
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5401&view=rev
Author:   einhverfr
Date:     2012-12-24 13:49:02 +0000 (Mon, 24 Dec 2012)
Log Message:
-----------
Adding user migration in 1.2-1.3 upgrade (will be merged with 1.2-1.4) and fixing handling of jcitems.total

Modified Paths:
--------------
    branches/1.3/Changelog
    branches/1.3/sql/upgrade/1.2-1.3.sql

Modified: branches/1.3/Changelog
===================================================================
--- branches/1.3/Changelog	2012-12-23 05:23:53 UTC (rev 5400)
+++ branches/1.3/Changelog	2012-12-24 13:49:02 UTC (rev 5401)
@@ -8,6 +8,8 @@
 * Fixed prepare-company-database.sh clobbering the Apache configuration on
   every run (Chris T, 3595000)
 * Fixed error sorting recon search by account (Chris T, h/t Erik H, 3589473)
+* Users are now migrated with nonsense passwords from 1,2 (Chris T, 3587257)
+* Upgrade now handles new total column in jcitems properly (Chris T)
 * Fixed configure_apache.sh, read input, change of file name from 
   ledgersmb-httpd.conf to ledgersmb-httpd.conf.template (Havard S)
 * Update INSTALL - section "Adding configuration to Apache 2.x" (Havard S)

Modified: branches/1.3/sql/upgrade/1.2-1.3.sql
===================================================================
--- branches/1.3/sql/upgrade/1.2-1.3.sql	2012-12-23 05:23:53 UTC (rev 5400)
+++ branches/1.3/sql/upgrade/1.2-1.3.sql	2012-12-24 13:49:02 UTC (rev 5401)
@@ -361,19 +361,31 @@
 INSERT INTO person (first_name, last_name, entity_id) 
 select name, name, entity_id FROM lsmb12.employee;
 
-INSERT INTO users (entity_id, username)
-     SELECT entity_id, login FROM lsmb12.employee em
-      WHERE login IS NOT NULL;
-
 INSERT 
   INTO entity_employee(entity_id, startdate, enddate, role, ssn, sales,
        employeenumber, dob, manager_id)
 SELECT entity_id, startdate, enddate, role, ssn, sales, employeenumber, dob,
        (select entity_id from lsmb12.employee where id = em.managerid)
-  FROM lsmb12.employee em;
+  FROM lsmb12.employee em
+ WHERE id IN (select min(id) from lsmb12.employee group by entity_id);
 
 
+-- I would prefer stronger passwords here but the exposure is very short, since 
+-- the passwords time out after 24 hours anyway.  These are not assumed to be
+-- usable passwords. --CT
 
+SELECT admin__save_user(null, max(entity_id), login, random()::text, true)
+  FROM lsmb12.employee
+ WHERE login IN (select rolname FROM pg_roles)
+ GROUP BY login;
+
+SELECT 	admin__save_user(null, max(entity_id), login, random()::text, false)
+  FROM lsmb12.employee
+ WHERE login NOT IN (select rolname FROM pg_roles)
+ GROUP BY login;
+
+
+
 -- must rebuild this table due to changes since 1.2
 
 -- needed to handle null values
@@ -565,9 +577,6 @@
        JOIN lsmb12.employee e ON a.employee_id = e.id
        JOIN person p on e.entity_id = p.entity_id;
 
-INSERT INTO user_preference(id)
-     SELECT id from users;
-
 INSERT INTO recurring SELECT * FROM lsmb12.recurring;
 
 INSERT INTO recurringemail SELECT * FROM lsmb12.recurringemail;
@@ -576,10 +585,10 @@
 
 INSERT INTO jcitems(id, project_id, parts_id, description, qty, allocated,
             sellprice, fxsellprice, serialnumber, checkedin, checkedout,
-            person_id, notes)
+            person_id, notes, total)
      SELECT j.id,  project_id, parts_id, description, qty, allocated,
             sellprice, fxsellprice, serialnumber, checkedin, checkedout,
-            p.id, j.notes
+            p.id, j.notes, coalesce(qty, 0)
        FROM lsmb12.jcitems j
        JOIN lsmb12.employee e ON j.employee_id = e.id
        JOIN person p ON e.entity_id = p.entity_id;

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