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

Re: 1.2 to 1.3 Upgrade fun



Hi Lyle,

 
  Ok, I got further, here is a patch for setup.pl:

[ snip ] 

Thanks for the patch!

Not many errors now:

psql:/tmp/ledgersmb/1.2-1.3-upgrade.sql:358: ERROR:  new row for relation "entity" violates check constraint "entity_name_check"

DETAIL:  Failing row contains (389, , 3, 2014-03-23, E-2, 78).
psql:/tmp/ledgersmb/1.2-1.3-upgrade.sql:364: ERROR:  null value in column "entity_id" violates not-null constraint

DETAIL:  Failing row contains (1, null, null, , null, , 2014-03-23).
psql:/tmp/ledgersmb/1.2-1.3-upgrade.sql:372: ERROR:  null value in column "entity_id" violates not-null constraint

DETAIL:  Failing row contains (null, 2011-04-12, null, user, null, t, null, 2, null).
psql:/tmp/ledgersmb/1.2-1.3-upgrade.sql:387: ERROR:  null value in column "entity_id" violates not-null constraint


The first error (violation of the "entity_name_check") probably causes the other errors: no entity_id is assigned to the entity which fails the check. Then later on, the entity with the null value in the entity_id column can't be inserted / used as expected.


To find out which record failed the check, run the following query in the new database on which you have tried running your migration:

 $ select * from lsmb12.employee where entity_id is null;


Or this query on your LedgerSMB 1.2 database which you haven't migrated yet:

 $ select * from employee where not (name ~ '[[:alnum:]_]'::text);



Hope that helps!

This check should be added to the pre-migration checks as well, thanks for your feedback!


--
Bye,

Erik.

http://efficito.com -- Hosted accounting and ERP.
Robust and Flexible. No vendor lock-in.