Can you try something like "select user_id from user where user_id not it
(select person_id from person)" and see what that looks like? It shouldn't
have been possible for you to have users whose user_id was not equals to the
person_id of a person before 1.6, even though there was no db constraint for
this.

-Darius

On Tue, Sep 27, 2011 at 10:02 AM, Rob Borland <[email protected]>wrote:

> Upgrading OpenMRS 1.4.6 to 1.6.3 fails with this error:
>
> OpenMRS Installation Wizard
>
>    * There was an error while updating the database to the latest. file:
> liquibase-update-to-latest.**xml. Error: Migration failed for change set
> liquibase-update-to-latest.**xml::200912031846-3::**djazayeri: Reason:
> liquibase.exception.**JDBCException: Error executing SQL ALTER TABLE
> `users` ADD CONSTRAINT `person_id_for_user` FOREIGN KEY (`person_id`)
> REFERENCES `person`(`person_id`): Caused By: Error executing SQL ALTER TABLE
> `users` ADD CONSTRAINT `person_id_for_user` FOREIGN KEY (`person_id`)
> REFERENCES `person`(`person_id`): Caused By: Cannot add or update a child
> row: a foreign key constraint fails (`openmrs`.`#sql-3ed_59`, CONSTRAINT
> `person_id_for_user` FOREIGN KEY (`person_id`) REFERENCES `person`
> (`person_id`)) Error while trying to update to the latest database version
>
>
> I can force the change by disabling foreign key checks but I get the same
> error when I reopen the web app.
>
> I'd appreciate any advice.
>
> Regards,
> Rob
>
> ______________________________**___________
>
> To unsubscribe from OpenMRS Implementers' mailing list, send an e-mail to
> [email protected] with "SIGNOFF openmrs-implement-l" in the
>  body (not the subject) of your e-mail.
>
> [mailto:LISTSERV@LISTSERV.**IUPUI.EDU <[email protected]>
> ?body=SIGNOFF%**20openmrs-implement-l]
>

_________________________________________

To unsubscribe from OpenMRS Implementers' mailing list, send an e-mail to 
[email protected] with "SIGNOFF openmrs-implement-l" in the  body 
(not the subject) of your e-mail.

[mailto:[email protected]?body=SIGNOFF%20openmrs-implement-l]

Reply via email to