Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrity constraint violation while upgrading #41

Closed
miquelbofill opened this issue Sep 29, 2020 · 2 comments
Closed

Integrity constraint violation while upgrading #41

miquelbofill opened this issue Sep 29, 2020 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@miquelbofill
Copy link

I got the following FOREIGN KEY integrity constraint violation while trying to migrate the database to version 5.5.0. Any ideas?

500 Internal Server Error
Database error: SQLSTATE[23000]: Integrity constraint violation: 19 FOREIGN KEY constraint failed #0 /usr/share/i-librarian/classes/storage/database.php(237): PDOStatement->execute() #1 /usr/share/i-librarian/app/models/migration.php(726): Librarian\Storage\Database->run() #2 /usr/share/i-librarian/app/models/migration.php(93): LibrarianApp\MigrationModel->_legacyLibrary() #3 [internal function]: LibrarianApp\MigrationModel->_legacyupgrade() #4 /usr/share/i-librarian/classes/mvc/model.php(125): call_user_func_array() #5 /usr/share/i-librarian/app/controllers/migration.php(78): Librarian\Mvc\Model->__call() #6 /usr/share/i-librarian/classes/router.php(117): LibrarianApp\MigrationController->legacyupgradeAction() #7 /usr/share/i-librarian/classes/application.php(103): Librarian\Router->dispatch() #8 /usr/share/i-librarian/public/index.php(156): Librarian\Application->handle() #9 {main}.

@mkucej
Copy link
Owner

mkucej commented Sep 29, 2020

The old database probably has some incorrect data. If you don't need to migrate your Shelf, you could try to comment out this line and try again:
https://github.com/mkucej/i-librarian-free/blob/master/app/models/migration.php#L726

@mkucej mkucej added the question Further information is requested label Sep 29, 2020
@mkucej mkucej self-assigned this Sep 29, 2020
@miquelbofill
Copy link
Author

It worked. Many thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants