[Bug Report] Database Migration Failure #5494
-
Whenever I attempt to upgrade from 0.26.2 to 0.27+ database migration fails. To Reproduce Expected behavior Screenshots Full Error TextAn error occurred migrating the database to the latest schema version. The backup database file was automatically renamed to restore the database. error performing migration: error running migration for schema 62: UNIQUE constraint failed: performers.name in line 0: PRAGMA foreign_keys=OFF; CREATE TABLE CREATE INDEX -- drop url, twitter and instagram INSERT INTO INSERT INTO INSERT INTO INSERT INTO DROP INDEX IF EXISTS CREATE UNIQUE INDEX PRAGMA foreign_keys=ON; Stash Version: (from Settings -> About): 26.2 database schema version 58. Error appears to happen when migrating to schema 62. Additional context |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This appears to be a corruption in your database caused by the post-migration for schema version 42 not apparently running. As a result, it's allowed duplicate performer names to be created in your system. These performers will need to be renamed manually before you can migrate your system to the latest version (which will add the missing unique constraints as well). You should be able to get the duplicate performers with the following graphql query, which can be run using
|
Beta Was this translation helpful? Give feedback.
-
Cheers for this. I was starting to assume I must've had a duplicate performer without disambig. I couldn't find anything to filter in the WebUI beyond manually going through all 4600 performers and noticing a duplicate. This fixed my issue. Thanks so much. |
Beta Was this translation helpful? Give feedback.
This appears to be a corruption in your database caused by the post-migration for schema version 42 not apparently running. As a result, it's allowed duplicate performer names to be created in your system. These performers will need to be renamed manually before you can migrate your system to the latest version (which will add the missing unique constraints as well).
You should be able to get the duplicate performers with the following graphql query, which can be run using
<server>:<port>/playground
: