github stumpapp/stump v0.0.7

one month ago

⚠️ This version contains breaking changes which will likely cause all books, series, and related entities (e.g. reading progress) to be dropped from the database. Please back up your existing database file before updating. You can restore the lost data using the attached resolve-missing-data.sql SQL script. The contents are as follows:

-- This SQL file is used to 'fix' the data in the database after the migration. BE SURE TO BACKUP BEFORE UPDATING:

-- 1. open the newly migrated database in your preferred SQLite client, I use TablePlus but it doesn't matter. You may also use the CLI e.g. sqlite3 stump.db < resolve-missing-data.sql
--    you must use absolute paths to the databases, replace with your path
ATTACH DATABASE '/replace/with/full/path/to/stump-before-migration.db' as 'backup';

-- 2. run the following SQL to copy the data from the old database to the new database, the tables we want data from are:
--    - `series`
--    - `series_metadata`
--    - `media`
--    - `media_metadata`
--    - `media_annotations`
--    - `reading_sesssions`
--    - `finished_reading_sessions`
-- The order is somewhat important, even though we adjust the PRAGMA foreign_keys = OFF; it is a safe precaution to follow the order above
BEGIN;
PRAGMA foreign_keys = OFF;
INSERT INTO series SELECT * FROM backup.series;
INSERT INTO series_metadata SELECT * FROM backup.series_metadata;
INSERT INTO media SELECT * FROM backup.media;
INSERT INTO media_metadata SELECT * FROM backup.media_metadata;
INSERT INTO media_annotations SELECT * FROM backup.media_annotations;
INSERT INTO reading_sessions SELECT * FROM backup.reading_sessions;
INSERT INTO finished_reading_sessions SELECT * FROM backup.finished_reading_sessions;
PRAGMA foreign_keys = ON;
PRAGMA foreign_key_check;
COMMIT;

You may execute the script using the CLI:

sqlite3 stump.db < resolve-missing-data.sql 

This should restore all of the dropped data, however I can't make guarantees it would work for everyone and their setup. You may also just issue a scan and it will populate all but the reading progress.

What's Changed

New Contributors

Full Changelog: v0.0.6...v0.0.7

Don't miss a new stump release

NewReleases is sending notifications on new releases.