[solved] SQLite in expo with useMigrations is failing without any error (just rollback)

I just tried to add a bunch of indexes to my SQLite DB, and the migration consistently fails to apply and I'm not getting any useful error message. Anyone have any ideas or how to better debug this?
LOG Query: CREATE INDEX `person_index` ON `authors` (`url`,`person_id`);
LOG Query:
CREATE INDEX `author_index` ON `book_authors` (`url`,`author_id`);
LOG Query:
CREATE INDEX `book_index` ON `book_authors` (`url`,`book_id`);
LOG Query:
CREATE INDEX `published_index` ON `books` (`published`);
LOG Query:
CREATE INDEX `media_index` ON `local_player_states` (`url`,`media_id`);
LOG Query: ROLLBACK
ERROR Migration error [DrizzleError: Failed to run the query '
CREATE INDEX `book_index` ON `media` (`url`,`book_id`);']
LOG Query: CREATE INDEX `person_index` ON `authors` (`url`,`person_id`);
LOG Query:
CREATE INDEX `author_index` ON `book_authors` (`url`,`author_id`);
LOG Query:
CREATE INDEX `book_index` ON `book_authors` (`url`,`book_id`);
LOG Query:
CREATE INDEX `published_index` ON `books` (`published`);
LOG Query:
CREATE INDEX `media_index` ON `local_player_states` (`url`,`media_id`);
LOG Query: ROLLBACK
ERROR Migration error [DrizzleError: Failed to run the query '
CREATE INDEX `book_index` ON `media` (`url`,`book_id`);']
I had it working for most indexes except two, I thought there was maybe something weird about that table, so I removed those and the rest worked fine. Now after a complete reset (clear app data) and a fresh migration from the ground up, it's failing to create a different index...
1 Reply
Chris Dosé
Chris DoséOP•3mo ago
oh... do the names have to be unique? This is not made clear 😅 wish the error message told me this!
Want results from more Discord servers?
Add your server