On Fri, 7 Oct 2011, [email protected] wrote:
>
> This time making it to
>
> INSERT INTO audittrail(trans_id, tablename, reference, formname, action,
> transdate, person_id, entry_id)
> SELECT trans_id, tablename, reference, formname, action,
> transdate, p.id, entry_id
> FROM lsmb12.audittrail a
> JOIN lsmb12.employee e ON a.employee_id = e.id
> JOIN person p on e.entity_id = p.entity_id;
>
> psql:sql/upgrade/1.2-1.3-manual.sql:582: ERROR: insert or update on table
> "audittrail" violates foreign key constraint "audittrail_person_id_fkey"
> DETAIL: Key (person_id)=(1) is not present in table "person".
>
It looks like either the contraint
"audittrail_person_id_fkey" FOREIGN KEY (person_id) REFERENCES
person(entity_id)
should be
"audittrail_person_id_fkey" FOREIGN KEY (person_id) REFERENCES
person(id)
OR
the query should be
INSERT INTO audittrail(trans_id, tablename, reference, formname, action,
transdate, person_id, entry_id)
SELECT trans_id, tablename, reference, formname, action,
transdate, p.entity_id, entry_id
FROM lsmb12.audittrail a
JOIN lsmb12.employee e ON a.employee_id = e.id
JOIN person p on e.entity_id = p.entity_id;
I'm going to change the query and see what happens to the clone DB.
and it runs to completion!
...
UPDATE defaults SET value = '1.2.99' WHERE setting_key = 'version';
UPDATE 1
COMMIT;
COMMIT
--TODO: Translation migratiion. Partsgroups?
-- TODO: User/password Migration
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Ledger-smb-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel