You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever I attempt to upgrade from 0.26.2 to 0.27+ database migration fails.
I'm able to roll back to 2.6.2 and Stash continues to function normally.
Have cleaned, and optimized database and attempted to rerun.
To Reproduce
Update docker container to 0.27 or 0.27.1
Expected behavior
Would expect the migration to finish without errors as it always has in the past.
Screenshots
Not really a screenshot but just the error that is dumped while migrating the database.
What seems like the relevant part of the error to me: "error performing migration: error running migration for schema 62: no such index: performers_name_disambiguation_unique in line 0: PRAGMA foreign_keys=OFF;"
Full Error Text
`An 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: no such index: performers_name_disambiguation_unique in line 0: PRAGMA foreign_keys=OFF;
CREATE TABLE performer_urls ( performer_id integer NOT NULL, position integer NOT NULL, url varchar(255) NOT NULL,
foreign key(performer_id) references performers(id) on delete CASCADE,
PRIMARY KEY(performer_id, position, url)
);
CREATE INDEX performers_urls_url on performer_urls (url);
-- drop url, twitter and instagram
-- make name not null
CREATE TABLE performers_new ( id integer not null primary key autoincrement, name varchar(255) not null, disambiguation varchar(255), gender varchar(20), birthdate date, ethnicity varchar(255), country varchar(255), eye_color varchar(255), height int, measurements varchar(255), fake_tits varchar(255), career_length varchar(255), tattoos varchar(255), piercings varchar(255), favorite boolean not null default '0', created_at datetime not null, updated_at datetime not null, details text, death_date date, hair_color varchar(255), weight integer, rating tinyint, ignore_auto_tag boolean not null default '0', image_blob varchar(255) REFERENCES blobs(checksum), penis_length float, circumcised varchar[10]
);
INSERT INTO performer_urls
( performer_id, position, url
)
SELECT id,
'0', url
FROM performers
WHERE performers.url IS NOT NULL AND performers.url != '';
INSERT INTO performer_urls
( performer_id, position, url
)
SELECT id,
(SELECT count(*) FROM performer_urls WHERE performer_id = performers.id)+1,
CASE
WHEN twitter LIKE 'http%://%' THEN twitter
ELSE 'https://www.twitter.com/' || twitter
END
FROM performers
WHERE performers.twitter IS NOT NULL AND performers.twitter != '';
INSERT INTO performer_urls
( performer_id, position, url
)
SELECT id,
(SELECT count(*) FROM performer_urls WHERE performer_id = performers.id)+1,
CASE
WHEN instagram LIKE 'http%://%' THEN instagram
ELSE 'https://www.instagram.com/' || instagram
END
FROM performers
WHERE performers.instagram IS NOT NULL AND performers.instagram != '';
DROP INDEX performers_name_disambiguation_unique;
DROP INDEX performers_name_unique;
DROP TABLE performers;
ALTER TABLE performers_new rename to performers;
CREATE UNIQUE INDEX performers_name_disambiguation_unique on performers (name, disambiguation) WHERE disambiguation IS NOT NULL;
CREATE UNIQUE INDEX performers_name_unique on performers (name) WHERE disambiguation IS NULL;
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
I did attempt to get help on the Discord first but didn't get any responses.
The text was updated successfully, but these errors were encountered:
This didn't seem to fix the issue. I tried both Arshad-k7's fork as well as the updated 0.27.2 release.
I assume it's got something to do with performers with the same name and a disambiguation line in them.
Whenever I attempt to upgrade from 0.26.2 to 0.27+ database migration fails.
I'm able to roll back to 2.6.2 and Stash continues to function normally.
Have cleaned, and optimized database and attempted to rerun.
To Reproduce
Update docker container to 0.27 or 0.27.1
Expected behavior
Would expect the migration to finish without errors as it always has in the past.
Screenshots
Not really a screenshot but just the error that is dumped while migrating the database.
What seems like the relevant part of the error to me: "error performing migration: error running migration for schema 62: no such index: performers_name_disambiguation_unique in line 0: PRAGMA foreign_keys=OFF;"
Full Error Text
`An 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: no such index: performers_name_disambiguation_unique in line 0: PRAGMA foreign_keys=OFF;
CREATE TABLE
performer_urls
(performer_id
integer NOT NULL,position
integer NOT NULL,url
varchar(255) NOT NULL,foreign key(
performer_id
) referencesperformers
(id
) on delete CASCADE,PRIMARY KEY(
performer_id
,position
,url
));
CREATE INDEX
performers_urls_url
onperformer_urls
(url
);-- drop url, twitter and instagram
-- make name not null
CREATE TABLE
performers_new
(id
integer not null primary key autoincrement,name
varchar(255) not null,disambiguation
varchar(255),gender
varchar(20),birthdate
date,ethnicity
varchar(255),country
varchar(255),eye_color
varchar(255),height
int,measurements
varchar(255),fake_tits
varchar(255),career_length
varchar(255),tattoos
varchar(255),piercings
varchar(255),favorite
boolean not null default '0',created_at
datetime not null,updated_at
datetime not null,details
text,death_date
date,hair_color
varchar(255),weight
integer,rating
tinyint,ignore_auto_tag
boolean not null default '0',image_blob
varchar(255) REFERENCESblobs
(checksum
),penis_length
float,circumcised
varchar[10]);
INSERT INTO
performers_new
(
id
,name
,disambiguation
,gender
,birthdate
,ethnicity
,country
,eye_color
,height
,measurements
,fake_tits
,career_length
,tattoos
,piercings
,favorite
,created_at
,updated_at
,details
,death_date
,hair_color
,weight
,rating
,ignore_auto_tag
,image_blob
,penis_length
,circumcised
)
SELECT
id
,name
,disambiguation
,gender
,birthdate
,ethnicity
,country
,eye_color
,height
,measurements
,fake_tits
,career_length
,tattoos
,piercings
,favorite
,created_at
,updated_at
,details
,death_date
,hair_color
,weight
,rating
,ignore_auto_tag
,image_blob
,penis_length
,circumcised
FROM
performers
;INSERT INTO
performer_urls
(
performer_id
,position
,url
)
SELECT
id
,'0',
url
FROM
performers
WHERE
performers
.url
IS NOT NULL ANDperformers
.url
!= '';INSERT INTO
performer_urls
(
performer_id
,position
,url
)
SELECT
id
,(SELECT count(*) FROM
performer_urls
WHEREperformer_id
=performers
.id
)+1,CASE
WHEN
twitter
LIKE 'http%://%' THENtwitter
ELSE 'https://www.twitter.com/' ||
twitter
END
FROM
performers
WHERE
performers
.twitter
IS NOT NULL ANDperformers
.twitter
!= '';INSERT INTO
performer_urls
(
performer_id
,position
,url
)
SELECT
id
,(SELECT count(*) FROM
performer_urls
WHEREperformer_id
=performers
.id
)+1,CASE
WHEN
instagram
LIKE 'http%://%' THENinstagram
ELSE 'https://www.instagram.com/' ||
instagram
END
FROM
performers
WHERE
performers
.instagram
IS NOT NULL ANDperformers
.instagram
!= '';DROP INDEX
performers_name_disambiguation_unique
;DROP INDEX
performers_name_unique
;DROP TABLE
performers
;ALTER TABLE
performers_new
rename toperformers
;CREATE UNIQUE INDEX
performers_name_disambiguation_unique
onperformers
(name
,disambiguation
) WHEREdisambiguation
IS NOT NULL;CREATE UNIQUE INDEX
performers_name_unique
onperformers
(name
) WHEREdisambiguation
IS NULL;PRAGMA foreign_keys=ON;`
Additional context
I did attempt to get help on the Discord first but didn't get any responses.
The text was updated successfully, but these errors were encountered: