feat(db): drop the acquisition and Discover tables
release / web (push) Successful in 1m22s
release / go (push) Successful in 1m49s
release / govulncheck (push) Successful in 18s
release / integration (push) Successful in 4m10s
release / android (push) Successful in 4m27s
release / Build signed APK (push) Successful in 4m56s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 22s
release / Verify release artifacts (tag releases only) (push) Skipped
release / web (push) Successful in 1m22s
release / go (push) Successful in 1m49s
release / govulncheck (push) Successful in 18s
release / integration (push) Successful in 4m10s
release / android (push) Successful in 4m27s
release / Build signed APK (push) Successful in 4m56s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 22s
release / Verify release artifacts (tag releases only) (push) Skipped
Migration 105 removes the tables the acquisition and Discover features kept, and users.auto_approve_requests. Before library_album_matches goes, an album with no release-group MBID takes the one its match listed. Tables drop without CASCADE, in reference order, so a reference from a table that stays stops the migration. The down migration refuses: the data is gone, and a backup from before it is the way back. The backup table list, the test reset list and the duplicate and user queries follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -15,9 +15,9 @@ func sample() Contents {
|
||||
return Contents{
|
||||
Schema: 98,
|
||||
Tables: map[string][][]byte{
|
||||
"users": {[]byte(`{"id":"u1","username":"ada"}`), []byte(`{"id":"u2","username":"bo"}`)},
|
||||
"tracks": {[]byte(`{"file_path":"/music/a.flac","id":"t1"}`)},
|
||||
"wants": {},
|
||||
"users": {[]byte(`{"id":"u1","username":"ada"}`), []byte(`{"id":"u2","username":"bo"}`)},
|
||||
"tracks": {[]byte(`{"file_path":"/music/a.flac","id":"t1"}`)},
|
||||
"playlists": {},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,8 +153,6 @@ func TestARestoredInstanceHoldsWhatTheBackupHeld_Integration(t *testing.T) {
|
||||
playlist := mustID(t, pool, `INSERT INTO playlists (user_id, name) VALUES ($1, 'Mine') RETURNING id::text`, user)
|
||||
mustExec(t, pool, `INSERT INTO playlist_tracks (playlist_id, position, track_id, title, artist_name, album_title, duration_sec)
|
||||
VALUES ($1, 0, $2, 'Track', 'Artist', 'Album', 180)`, playlist, track)
|
||||
mustExec(t, pool, `INSERT INTO follows (artist_mbid, artist_name, profile_id, followed_by)
|
||||
SELECT 'mbid-1', 'Artist', id, $1 FROM release_type_profiles WHERE is_default`, user)
|
||||
mustExec(t, pool, `INSERT INTO library_changes (entity_type, entity_id, op) VALUES ('track', $1, 'upsert')`, track)
|
||||
|
||||
first, err := backup.Snapshot(ctx, pool)
|
||||
@@ -174,7 +172,7 @@ func TestARestoredInstanceHoldsWhatTheBackupHeld_Integration(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
for _, tbl := range []string{"users", "tracks", "play_events", "general_likes", "playlist_tracks", "follows", "library_changes"} {
|
||||
for _, tbl := range []string{"users", "tracks", "play_events", "general_likes", "playlist_tracks", "library_changes"} {
|
||||
if len(first.Tables[tbl]) == 0 {
|
||||
t.Errorf("the backup holds no %s", tbl)
|
||||
}
|
||||
|
||||
+11
-34
@@ -2,8 +2,7 @@
|
||||
// Lines, one table at a time, and loads it back into an empty instance.
|
||||
//
|
||||
// What goes in is everything a person made or decided: accounts, likes, play
|
||||
// and skip history, playlists, follows, wants and requests, download history,
|
||||
// admin decisions, and settings. What stays out is everything the restored
|
||||
// and skip history, playlists, admin decisions, and settings. What stays out is everything the restored
|
||||
// server rebuilds by itself: what it computes from the music files, what it
|
||||
// fetches again from MusicBrainz, ListenBrainz and the other providers, and
|
||||
// logs of past runs. Excluded says why for each, and the coverage test fails
|
||||
@@ -50,24 +49,10 @@ var Tables = []Table{
|
||||
{Name: "cover_art_sources_meta"},
|
||||
{Name: "tag_provider_settings", Omit: []string{"api_key"}},
|
||||
{Name: "tag_sources_meta"},
|
||||
{Name: "acquisition_services", Omit: []string{"api_key", "password"}},
|
||||
{Name: "acquisition_settings"},
|
||||
{Name: "reacquisition_settings"},
|
||||
{Name: "discover_tuning"},
|
||||
{Name: "taste_tuning"},
|
||||
{Name: "recommendation_weight_profiles"},
|
||||
{Name: "recommendation_tuning_audit"},
|
||||
|
||||
// Follows, wants, requests and downloads.
|
||||
{Name: "release_type_profiles"},
|
||||
{Name: "follows"},
|
||||
{Name: "follow_seen_groups"},
|
||||
{Name: "wants"},
|
||||
{Name: "grabs"},
|
||||
{Name: "download_interventions"},
|
||||
{Name: "release_blocks"},
|
||||
{Name: "requests"},
|
||||
|
||||
// Listening history and likes.
|
||||
{Name: "play_sessions"},
|
||||
{Name: "play_events"},
|
||||
@@ -97,13 +82,11 @@ var Tables = []Table{
|
||||
{Name: "user_notification_prefs"},
|
||||
{Name: "user_notification_email_state"},
|
||||
{Name: "user_notifications"},
|
||||
{Name: "suggestion_snoozes"},
|
||||
{Name: "quarantine"},
|
||||
{Name: "quarantine_actions"},
|
||||
|
||||
// Admin decisions: an album taken off the wanted listing stays off, and a
|
||||
// dismissed duplicate group stays dismissed when the sweep finds it again.
|
||||
{Name: "library_album_matches"},
|
||||
// Admin decisions: a dismissed duplicate group stays dismissed when the
|
||||
// sweep finds it again.
|
||||
{Name: "duplicate_sweeps"},
|
||||
{Name: "duplicate_groups"},
|
||||
{Name: "duplicate_group_members"},
|
||||
@@ -123,28 +106,22 @@ var Excluded = map[string]string{
|
||||
"password_resets": "one-time reset links, which expire within hours",
|
||||
"user_invites": "open sign-up links; an admin sends an invite again from the restored server",
|
||||
|
||||
"track_fingerprints": "computed from the music files",
|
||||
"track_loudness": "computed from the music files",
|
||||
"album_loudness": "computed from the music files",
|
||||
"track_acoustid_lookups": "looked up again from each track's fingerprint",
|
||||
"track_tags": "fetched again from the tag providers",
|
||||
"candidate_artist_tags": "fetched again from the tag providers",
|
||||
"candidate_artist_tag_state": "fetched again from the tag providers",
|
||||
"track_fingerprints": "computed from the music files",
|
||||
"track_loudness": "computed from the music files",
|
||||
"album_loudness": "computed from the music files",
|
||||
"track_acoustid_lookups": "looked up again from each track's fingerprint",
|
||||
"track_tags": "fetched again from the tag providers",
|
||||
|
||||
"mb_artists": "MusicBrainz cache, fetched again",
|
||||
"mb_release_groups": "MusicBrainz cache, fetched again",
|
||||
"mb_releases": "MusicBrainz cache, fetched again",
|
||||
"mb_release_tracks": "MusicBrainz cache, fetched again",
|
||||
"mb_artist_release_groups": "MusicBrainz cache, fetched again",
|
||||
"mb_release_groups": "MusicBrainz cache, fetched again",
|
||||
"mb_releases": "MusicBrainz cache, fetched again",
|
||||
"mb_release_tracks": "MusicBrainz cache, fetched again",
|
||||
|
||||
"listenbrainz_similar_recordings": "similarity, fetched again from ListenBrainz",
|
||||
"track_similarity": "similarity, fetched again from the similarity providers",
|
||||
"track_similarity_fetches": "similarity, fetched again from the similarity providers",
|
||||
"artist_similarity": "similarity, fetched again from the similarity providers",
|
||||
"artist_similarity_fetches": "similarity, fetched again from the similarity providers",
|
||||
"artist_similarity_unmatched": "similarity, fetched again from the similarity providers",
|
||||
|
||||
"want_candidates": "the last search's results; the next search finds them again",
|
||||
"scan_runs": "a log of past library scans",
|
||||
"diagnostic_events": "debug-mode diagnostics",
|
||||
|
||||
|
||||
Reference in New Issue
Block a user