release / govulncheck (push) Successful in 17s
release / web (push) Successful in 1m33s
release / go (push) Successful in 1m49s
release / integration (push) Successful in 5m42s
release / android (push) Successful in 5m59s
release / Build signed APK (releases and dev) (push) Successful in 6m9s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 16s
release / Verify release artifacts (tag releases only) (push) Skipped
Applies rule 32's migration exception: each header still says what the schema was, what changes and what it prevents, but task, milestone, decision and rule ids are replaced by the practice they stood for, the operator quotes by the decision, single-install counts are dropped, and pointers to a deleted package and an external design doc are gone. golang-migrate keeps no checksum, so editing applied migrations' comments is safe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38 lines
2.0 KiB
SQL
38 lines
2.0 KiB
SQL
-- Import with verification: a finished download is checked
|
|
-- against the album it was grabbed for before anything reaches the library.
|
|
--
|
|
-- grabs (columns) how far the download has got, and what the import
|
|
-- made of it: the verdict, its reason and evidence,
|
|
-- where the files went.
|
|
-- grabs.end_reason a grab also ends by being imported, refused, or
|
|
-- found to be an album already held.
|
|
-- release_blocks.reason import: the files were not the album.
|
|
-- acquisition_settings which library folder new music is filed into
|
|
-- ('' = the first scan path).
|
|
ALTER TABLE grabs
|
|
ADD COLUMN progress real NOT NULL DEFAULT 0,
|
|
ADD COLUMN import_state text NOT NULL DEFAULT ''
|
|
CONSTRAINT grabs_import_state_check CHECK (import_state IN
|
|
('', 'downloading', 'waiting', 'importing', 'imported', 'refused', 'review', 'held', 'failed')),
|
|
ADD COLUMN import_reason text NOT NULL DEFAULT '',
|
|
ADD COLUMN import_detail jsonb NOT NULL DEFAULT '{}',
|
|
-- A person said "import anyway" to a download the check held for them.
|
|
ADD COLUMN import_forced boolean NOT NULL DEFAULT false,
|
|
ADD COLUMN import_attempts integer NOT NULL DEFAULT 0,
|
|
ADD COLUMN import_updated_at timestamptz,
|
|
ADD COLUMN imported_at timestamptz,
|
|
ADD COLUMN imported_files integer NOT NULL DEFAULT 0,
|
|
ADD COLUMN destination text NOT NULL DEFAULT '';
|
|
|
|
ALTER TABLE grabs DROP CONSTRAINT grabs_end_reason_check;
|
|
ALTER TABLE grabs ADD CONSTRAINT grabs_end_reason_check
|
|
CHECK (end_reason IN ('', 'superseded', 'imported', 'refused', 'held'));
|
|
|
|
CREATE INDEX grabs_live_idx ON grabs (grabbed_at) WHERE ended_at IS NULL;
|
|
|
|
ALTER TABLE release_blocks DROP CONSTRAINT release_blocks_reason_check;
|
|
ALTER TABLE release_blocks ADD CONSTRAINT release_blocks_reason_check
|
|
CHECK (reason IN ('operator', 'files', 'import'));
|
|
|
|
ALTER TABLE acquisition_settings ADD COLUMN import_root text NOT NULL DEFAULT '';
|