From 010378ae0320501cc8bb7d3d3de445fbb478c330 Mon Sep 17 00:00:00 2001 From: darrell-k Date: Sun, 25 May 2025 21:25:42 +0100 Subject: [PATCH 1/6] new column albums.version & associated logic Signed-off-by: darrell-k --- HTML/Default/status_list.html | 7 ++++++- HTML/EN/html/SqueezeJS/Base.js | 10 ++++++++++ HTML/EN/html/SqueezeJS/UI.js | 6 ++++-- SQL/SQLite/schema_26_down.sql | 0 SQL/SQLite/schema_26_up.sql | 24 ++++++++++++++++++++++++ SQL/mysql/schema_26_down.sql | 0 SQL/mysql/schema_26_up.sql | 24 ++++++++++++++++++++++++ Slim/Control/Commands.pm | 1 + Slim/Control/Queries.pm | 31 ++++++++++++++++++++++++------- Slim/Menu/AlbumInfo.pm | 1 + Slim/Menu/BrowseLibrary.pm | 5 +++-- Slim/Schema.pm | 11 ++++++++++- Slim/Schema/Album.pm | 3 +++ 13 files changed, 110 insertions(+), 13 deletions(-) create mode 100644 SQL/SQLite/schema_26_down.sql create mode 100644 SQL/SQLite/schema_26_up.sql create mode 100644 SQL/mysql/schema_26_down.sql create mode 100644 SQL/mysql/schema_26_up.sql diff --git a/HTML/Default/status_list.html b/HTML/Default/status_list.html index bd06841c14a..66531cf3478 100644 --- a/HTML/Default/status_list.html +++ b/HTML/Default/status_list.html @@ -50,7 +50,12 @@ [% IF item.includeAlbum && item.album.defined && item.album != noAlbum %]
[% IF item.album_id %] - [% item.album | html %] + [% IF item.version; + album_and_version = item.album _ ' [' _ item.version _ ']' ; + ELSE; + album_and_version = item.album; + END %] + [% album_and_version | html %] [% ELSE %][% item.album | html %][% END %]
[% END %] diff --git a/HTML/EN/html/SqueezeJS/Base.js b/HTML/EN/html/SqueezeJS/Base.js index 67e2ed21f67..a75b821b880 100644 --- a/HTML/EN/html/SqueezeJS/Base.js +++ b/HTML/EN/html/SqueezeJS/Base.js @@ -726,6 +726,16 @@ SqueezeJS.SonginfoParser = { }); }, + version : function(result, noLink){ + var version; + + if (result.playlist_tracks > 0 && result.playlist_loop[0].version) { + version = result.playlist_loop[0].version; + } + + return version; + }, + bitrate : function(result){ var bitrate = ''; diff --git a/HTML/EN/html/SqueezeJS/UI.js b/HTML/EN/html/SqueezeJS/UI.js index 51772638fa9..dd4c723490b 100644 --- a/HTML/EN/html/SqueezeJS/UI.js +++ b/HTML/EN/html/SqueezeJS/UI.js @@ -1559,14 +1559,16 @@ SqueezeJS.UI.CompoundTitle = Ext.extend(SqueezeJS.UI.Component, { SqueezeJS.UI.Album = Ext.extend(SqueezeJS.UI.Component, { onPlayerStateChange : function(result){ var year = SqueezeJS.SonginfoParser.year(result, this.noLink); + var version = SqueezeJS.SonginfoParser.version(result, this.noLink); this.el.update(SqueezeJS.SonginfoParser.album(result, this.noLink) - + (year ? ' (' + year + ')' : '')); + + (year ? ' (' + year + ')' : '') + (version ? ' [' + version + ']' : '') ); } }); SqueezeJS.UI.AlbumTitle = Ext.extend(SqueezeJS.UI.Component, { onPlayerStateChange : function(result){ - this.el.update(SqueezeJS.SonginfoParser.album(result, this.noLink)); + var version = SqueezeJS.SonginfoParser.version(result, this.noLink); + this.el.update(SqueezeJS.SonginfoParser.album(result, this.noLink) + (version ? ' [' + version + ']' : '')); } }); diff --git a/SQL/SQLite/schema_26_down.sql b/SQL/SQLite/schema_26_down.sql new file mode 100644 index 00000000000..e69de29bb2d diff --git a/SQL/SQLite/schema_26_up.sql b/SQL/SQLite/schema_26_up.sql new file mode 100644 index 00000000000..4cc56591895 --- /dev/null +++ b/SQL/SQLite/schema_26_up.sql @@ -0,0 +1,24 @@ +ALTER TABLE albums ADD version blob; +ALTER TABLE tracks ADD lms_persistent_id text; +DROP INDEX IF EXISTS albumsLabelIndex; +CREATE INDEX albumsLabelIndex ON albums (label); +DROP TABLE IF EXISTS labels; +CREATE TABLE labels ( + id integer PRIMARY KEY AUTOINCREMENT, + name blob, + namesort text, + namesearch text +); +DROP TABLE IF EXISTS label_album; +CREATE TABLE label_album ( + label int(10), + album int(10), + PRIMARY KEY (label,album), + FOREIGN KEY (`album`) REFERENCES `albums` (`id`) ON DELETE CASCADE, + FOREIGN KEY (`label`) REFERENCES `labels` (`id`) ON DELETE CASCADE +); +DROP INDEX IF EXISTS label_albumAlbumIndex; +CREATE INDEX label_albumAlbumIndex ON label_album (album); +DROP INDEX IF EXISTS label_albumLabelIndex; +CREATE INDEX label_albumLabelIndex ON label_album (label); + diff --git a/SQL/mysql/schema_26_down.sql b/SQL/mysql/schema_26_down.sql new file mode 100644 index 00000000000..e69de29bb2d diff --git a/SQL/mysql/schema_26_up.sql b/SQL/mysql/schema_26_up.sql new file mode 100644 index 00000000000..4cc56591895 --- /dev/null +++ b/SQL/mysql/schema_26_up.sql @@ -0,0 +1,24 @@ +ALTER TABLE albums ADD version blob; +ALTER TABLE tracks ADD lms_persistent_id text; +DROP INDEX IF EXISTS albumsLabelIndex; +CREATE INDEX albumsLabelIndex ON albums (label); +DROP TABLE IF EXISTS labels; +CREATE TABLE labels ( + id integer PRIMARY KEY AUTOINCREMENT, + name blob, + namesort text, + namesearch text +); +DROP TABLE IF EXISTS label_album; +CREATE TABLE label_album ( + label int(10), + album int(10), + PRIMARY KEY (label,album), + FOREIGN KEY (`album`) REFERENCES `albums` (`id`) ON DELETE CASCADE, + FOREIGN KEY (`label`) REFERENCES `labels` (`id`) ON DELETE CASCADE +); +DROP INDEX IF EXISTS label_albumAlbumIndex; +CREATE INDEX label_albumAlbumIndex ON label_album (album); +DROP INDEX IF EXISTS label_albumLabelIndex; +CREATE INDEX label_albumLabelIndex ON label_album (label); + diff --git a/Slim/Control/Commands.pm b/Slim/Control/Commands.pm index a3fbb748375..42efac8ccf4 100644 --- a/Slim/Control/Commands.pm +++ b/Slim/Control/Commands.pm @@ -3598,6 +3598,7 @@ sub _playlistXtracksCommand_parseDbItem { my $lcClass = lc($class); $classes{Album} = Slim::Schema->search('Album', { titlesearch => $albumObj->titlesearch, + version => $albumObj->version, "$lcClass.$key" => $value, },{ prefetch => $lcClass diff --git a/Slim/Control/Queries.pm b/Slim/Control/Queries.pm index 7447682a90f..ae3f490af9d 100644 --- a/Slim/Control/Queries.pm +++ b/Slim/Control/Queries.pm @@ -581,7 +581,7 @@ sub albumsQuery { if ( $tags =~ /l/ ) { # title/disc/discc is needed to construct (N of M) title - map { $c->{$_} = 1 } qw(albums.title albums.disc albums.discc); + map { $c->{$_} = 1 } qw(albums.title albums.version albums.disc albums.discc); } if ( $tags =~ /y/ ) { @@ -804,6 +804,7 @@ sub albumsQuery { while ( $sth->fetch ) { utf8::decode( $c->{'albums.title'} ) if exists $c->{'albums.title'}; + utf8::decode( $c->{'albums.version'} ) if exists $c->{'albums.version'}; utf8::decode( $c->{'works.title'} ) if exists $c->{'works.title'}; utf8::decode( $c->{'composer.name'} ) if exists $c->{'composer.name'}; utf8::decode( $c->{'tracks.performance'} ) if exists $c->{'tracks.performance'}; @@ -814,23 +815,31 @@ sub albumsQuery { $request->addResultLoopIfValueDefined($loopname, $chunkCount, 'composer', $c->{'composer.name'}); $request->addResultLoop($loopname, $chunkCount, 'performance', $c->{'tracks.performance'}||""); - my $favoritesUrl = $work - ? sprintf('db:album.title=%s&contributor.name=%s&work.title=%s&composer.name=%s&track.performance=%s', - URI::Escape::uri_escape_utf8($c->{'albums.title'}), URI::Escape::uri_escape_utf8($c->{'contributors.name'}), - URI::Escape::uri_escape_utf8($c->{'works.title'}), URI::Escape::uri_escape_utf8($c->{'composer.name'}), URI::Escape::uri_escape_utf8($c->{'tracks.performance'})) - : sprintf('db:album.title=%s&contributor.name=%s', URI::Escape::uri_escape_utf8($c->{'albums.title'}), URI::Escape::uri_escape_utf8($c->{'contributors.name'})); + my $favoritesUrl = sprintf('db:album.title=%s', URI::Escape::uri_escape_utf8($c->{'albums.title'})); + if ( $c->{'albums.version'} ) { + $favoritesUrl .= sprintf('&album.version=%s', URI::Escape::uri_escape_utf8($c->{'albums.version'})); + } + $favoritesUrl .= $work + ? sprintf('&contributor.name=%s&work.title=%s&composer.name=%s&track.performance=%s', + URI::Escape::uri_escape_utf8($c->{'contributors.name'}), URI::Escape::uri_escape_utf8($c->{'works.title'}), + URI::Escape::uri_escape_utf8($c->{'composer.name'}), URI::Escape::uri_escape_utf8($c->{'tracks.performance'})) + : sprintf('&contributor.name=%s', URI::Escape::uri_escape_utf8($c->{'contributors.name'})); # even if we have an extid, it cannot be used when we're dealing here with a work, which is a subset of the album. $request->addResultLoop($loopname, $chunkCount, 'favorites_url', $c->{'albums.extid'} && !$c->{'tracks.work'} ? $c->{'albums.extid'} : $favoritesUrl); my $favoritesTitle = $c->{'albums.title'}; + $favoritesTitle .= ' [' . $c->{'albums.version'} . ']' if $c->{'albums.version'}; if ( $work ) { $favoritesTitle = $c->{'composer.name'} ? $c->{'composer.name'} . cstring($client, 'COLON') . ' ' : ''; $favoritesTitle .= $c->{'works.title'} . ' ('; $favoritesTitle .= "$c->{'tracks.performance'} " if $c->{'tracks.performance'}; - $favoritesTitle .= cstring($client,'FROM') . ' ' . $c->{'albums.title'} . ')'; + $favoritesTitle .= cstring($client,'FROM') . ' ' . $c->{'albums.title'}; + $favoritesTitle .= ' [' . $c->{'albums.version'} . ']' if $c->{'albums.version'}; + $favoritesTitle .= ')'; } $request->addResultLoop($loopname, $chunkCount, 'favorites_title', $favoritesTitle); $tags =~ /l/ && $request->addResultLoop($loopname, $chunkCount, 'album', $construct_title->()); + $tags =~ /l/ && $request->addResultLoop($loopname, $chunkCount, 'version', $c->{'albums.version'}); $tags =~ /y/ && $request->addResultLoopIfValueDefined($loopname, $chunkCount, 'year', $c->{'albums.year'}); $tags =~ /j/ && $request->addResultLoopIfValueDefined($loopname, $chunkCount, 'artwork_track_id', $c->{'albums.artwork'}) if ($c->{'albums.artwork'} || '') !~ /^https?:/;; $tags =~ /K/ && $request->addResultLoopIfValueDefined($loopname, $chunkCount, 'artwork_url', $c->{'albums.artwork'}) if ($c->{'albums.artwork'} || '') =~ /^https?:/; @@ -5660,6 +5669,12 @@ sub _songDataFromHash { } } + # Special case for l (albums.title), return albums.version as well + elsif ( $tag eq 'l' ) { + $returnHash{'album'} = $res->{'albums.title'} if $res->{'albums.title'}; + $returnHash{'version'} = $res->{'albums.version'} if $res->{'albums.version'}; + } + # Special case for b (work), return work_id as well elsif ( $tag eq 'b' ) { $returnHash{'work'} = $res->{'works.title'} if $res->{'works.title'}; @@ -6391,6 +6406,7 @@ sub _getTagDataForTracks { $tags =~ /l/ && do { $join_albums->(); $c->{'albums.title'} = 1; + $c->{'albums.version'} = 1; }; $tags =~ /q/ && do { @@ -6517,6 +6533,7 @@ sub _getTagDataForTracks { utf8::decode( $c->{'works.title'} ) if exists $c->{'works.title'}; utf8::decode( $c->{'tracks.lyrics'} ) if exists $c->{'tracks.lyrics'}; utf8::decode( $c->{'albums.title'} ) if exists $c->{'albums.title'}; + utf8::decode( $c->{'albums.version'} ) if exists $c->{'albums.version'}; utf8::decode( $c->{'contributors.name'} ) if exists $c->{'contributors.name'}; utf8::decode( $c->{'genres.name'} ) if exists $c->{'genres.name'}; utf8::decode( $c->{'comments.value'} ) if exists $c->{'comments.value'}; diff --git a/Slim/Menu/AlbumInfo.pm b/Slim/Menu/AlbumInfo.pm index 38a5776a50b..b0469f7b605 100644 --- a/Slim/Menu/AlbumInfo.pm +++ b/Slim/Menu/AlbumInfo.pm @@ -367,6 +367,7 @@ sub infoAlbum { my $item; my $library_id = $filter->{library_id} || Slim::Music::VirtualLibraries->getLibraryIdForClient($client); my $albumName = $album->title; + $albumName .= ' [' . $album->version . ']' if $album->version; my $totalAlbumTracks = $album->tracks->count; if ( $albumName && $totalAlbumTracks > $filter->{track_count} ) { diff --git a/Slim/Menu/BrowseLibrary.pm b/Slim/Menu/BrowseLibrary.pm index 645737c8e22..c941b7e2318 100644 --- a/Slim/Menu/BrowseLibrary.pm +++ b/Slim/Menu/BrowseLibrary.pm @@ -1534,8 +1534,9 @@ sub _albums { $_->{'name'} .= "$_->{'performance'} " if $_->{'performance'}; $_->{'name'} .= cstring($client,'FROM') . ' '; } - $_->{'name'} .= $_->{'album'}; - $_->{'name'} .= ')' if $_->{'work_id'}; + $_->{'name'} .= $_->{'album'}; + $_->{'name'} .= ' [' . $_->{'version'} . ']' if $_->{'version'}; + $_->{'name'} .= ')' if $_->{'work_id'}; $_->{'image'} = 'music/' . $_->{'artwork_track_id'} . '/cover' if $_->{'artwork_track_id'}; $_->{'image'} ||= $_->{'artwork_url'} if $_->{'artwork_url'}; $_->{'type'} = 'playlist'; diff --git a/Slim/Schema.pm b/Slim/Schema.pm index 6b471647bbb..44adfe7c333 100644 --- a/Slim/Schema.pm +++ b/Slim/Schema.pm @@ -868,6 +868,7 @@ sub _objForDbUrl { if ($term =~ /(.*)=(.*)/) { my $key = $1; my $value = Slim::Utils::Misc::unescape($2); + $key = 'me.version' if $key eq 'album.version'; if (utf8::is_utf8($value)) { utf8::decode($value); @@ -904,6 +905,7 @@ sub _createOrUpdateAlbum { # Now handle Album creation my $title = $attributes->{ALBUM}; + my $version = $attributes->{VERSION}; my $disc = $attributes->{DISC}; my $discc = $attributes->{DISCC}; # Bug 10583 - Also check for MusicBrainz Album Id @@ -1046,6 +1048,7 @@ sub _createOrUpdateAlbum { ( $lastAlbum->{_dirname} && $lastAlbum->{_dirname} eq $basename && $lastAlbum->{title} eq $title + && $lastAlbum->{version} eq $version && (!$checkDisc || (($disc || '') eq ($lastAlbum->{disc} || 0))) ) ) { @@ -1070,6 +1073,9 @@ sub _createOrUpdateAlbum { push @{$search}, 'albums.title = ?'; push @{$values}, $title; + push @{$search}, 'albums.version = ?'; + push @{$values}, $version; + if (defined $brainzId) { push @{$search}, 'albums.musicbrainz_id = ?'; push @{$values}, $brainzId; @@ -1248,6 +1254,8 @@ sub _createOrUpdateAlbum { $albumHash->{release_type} = Slim::Utils::Text::ignoreCase( $releaseType || 'album' ); Slim::Schema::Album->addReleaseTypeMap($releaseType, $albumHash->{release_type}); + $albumHash->{version} = $attributes->{VERSION}; + # Bug 3255 - add album contributor which is either VA or the primary artist, used for sort by artist $vaObjId ||= $self->variousArtistsObject->id; @@ -1514,7 +1522,6 @@ sub _createWork { sub _createTrack { my ($self, $columnValueHash, $persistentColumnValueHash, $source) = @_; - # Create the track # Using native DBI here to improve performance during scanning my $dbh = $self->dbh; @@ -2814,6 +2821,8 @@ sub _preCheckAttributes { # We also need these in _postCheckAttributes, but they should be set during create() $deferredAttributes->{'DISC'} = $attributes->{'DISC'} if $attributes->{'DISC'}; + $deferredAttributes->{'VERSION'} = $attributes->{'VERSION'} || undef; + # thumb has gone away, since we have GD resizing. delete $attributes->{'THUMB'}; diff --git a/Slim/Schema/Album.pm b/Slim/Schema/Album.pm index 2ee7f52ba53..68600c3de4b 100644 --- a/Slim/Schema/Album.pm +++ b/Slim/Schema/Album.pm @@ -36,6 +36,9 @@ my $log = logger('database.info'); musicbrainz_id release_type extid + subtitle + label + version ), title => { accessor => undef() }); $class->set_primary_key('id'); From 6f247ed199dc3cf9bf66464a1c01e04eae11ad82 Mon Sep 17 00:00:00 2001 From: darrell-k Date: Wed, 28 May 2025 23:46:16 +0100 Subject: [PATCH 2/6] fix null version Signed-off-by: darrell-k --- Slim/Schema.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Slim/Schema.pm b/Slim/Schema.pm index 44adfe7c333..86c02d344e0 100644 --- a/Slim/Schema.pm +++ b/Slim/Schema.pm @@ -1073,8 +1073,12 @@ sub _createOrUpdateAlbum { push @{$search}, 'albums.title = ?'; push @{$values}, $title; - push @{$search}, 'albums.version = ?'; - push @{$values}, $version; + if ($version) { + push @{$search}, 'albums.version = ?'; + push @{$values}, $version; + } else { + push @{$search}, 'albums.version IS NULL'; + } if (defined $brainzId) { push @{$search}, 'albums.musicbrainz_id = ?'; From de3b99d80e2e86e3c3ff6a812e62fbe96eeb880a Mon Sep 17 00:00:00 2001 From: darrell-k Date: Wed, 30 Jul 2025 23:28:42 +0100 Subject: [PATCH 3/6] schema updates conflict resolution Signed-off-by: darrell-k --- SQL/SQLite/schema_27_down.sql | 0 SQL/SQLite/schema_27_up.sql | 24 ++++++++++++++++++++++++ SQL/mysql/schema_27_down.sql | 0 SQL/mysql/schema_27_up.sql | 24 ++++++++++++++++++++++++ 4 files changed, 48 insertions(+) create mode 100644 SQL/SQLite/schema_27_down.sql create mode 100644 SQL/SQLite/schema_27_up.sql create mode 100644 SQL/mysql/schema_27_down.sql create mode 100644 SQL/mysql/schema_27_up.sql diff --git a/SQL/SQLite/schema_27_down.sql b/SQL/SQLite/schema_27_down.sql new file mode 100644 index 00000000000..e69de29bb2d diff --git a/SQL/SQLite/schema_27_up.sql b/SQL/SQLite/schema_27_up.sql new file mode 100644 index 00000000000..4cc56591895 --- /dev/null +++ b/SQL/SQLite/schema_27_up.sql @@ -0,0 +1,24 @@ +ALTER TABLE albums ADD version blob; +ALTER TABLE tracks ADD lms_persistent_id text; +DROP INDEX IF EXISTS albumsLabelIndex; +CREATE INDEX albumsLabelIndex ON albums (label); +DROP TABLE IF EXISTS labels; +CREATE TABLE labels ( + id integer PRIMARY KEY AUTOINCREMENT, + name blob, + namesort text, + namesearch text +); +DROP TABLE IF EXISTS label_album; +CREATE TABLE label_album ( + label int(10), + album int(10), + PRIMARY KEY (label,album), + FOREIGN KEY (`album`) REFERENCES `albums` (`id`) ON DELETE CASCADE, + FOREIGN KEY (`label`) REFERENCES `labels` (`id`) ON DELETE CASCADE +); +DROP INDEX IF EXISTS label_albumAlbumIndex; +CREATE INDEX label_albumAlbumIndex ON label_album (album); +DROP INDEX IF EXISTS label_albumLabelIndex; +CREATE INDEX label_albumLabelIndex ON label_album (label); + diff --git a/SQL/mysql/schema_27_down.sql b/SQL/mysql/schema_27_down.sql new file mode 100644 index 00000000000..e69de29bb2d diff --git a/SQL/mysql/schema_27_up.sql b/SQL/mysql/schema_27_up.sql new file mode 100644 index 00000000000..4cc56591895 --- /dev/null +++ b/SQL/mysql/schema_27_up.sql @@ -0,0 +1,24 @@ +ALTER TABLE albums ADD version blob; +ALTER TABLE tracks ADD lms_persistent_id text; +DROP INDEX IF EXISTS albumsLabelIndex; +CREATE INDEX albumsLabelIndex ON albums (label); +DROP TABLE IF EXISTS labels; +CREATE TABLE labels ( + id integer PRIMARY KEY AUTOINCREMENT, + name blob, + namesort text, + namesearch text +); +DROP TABLE IF EXISTS label_album; +CREATE TABLE label_album ( + label int(10), + album int(10), + PRIMARY KEY (label,album), + FOREIGN KEY (`album`) REFERENCES `albums` (`id`) ON DELETE CASCADE, + FOREIGN KEY (`label`) REFERENCES `labels` (`id`) ON DELETE CASCADE +); +DROP INDEX IF EXISTS label_albumAlbumIndex; +CREATE INDEX label_albumAlbumIndex ON label_album (album); +DROP INDEX IF EXISTS label_albumLabelIndex; +CREATE INDEX label_albumLabelIndex ON label_album (label); + From 530b280940d60cc899aff6ed8f9eefaed538ab8a Mon Sep 17 00:00:00 2001 From: darrell-k Date: Wed, 30 Jul 2025 23:32:56 +0100 Subject: [PATCH 4/6] SQL conflict Signed-off-by: darrell-k --- SQL/SQLite/schema_26_down.sql | 0 SQL/mysql/schema_26_down.sql | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 SQL/SQLite/schema_26_down.sql delete mode 100644 SQL/mysql/schema_26_down.sql diff --git a/SQL/SQLite/schema_26_down.sql b/SQL/SQLite/schema_26_down.sql deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/SQL/mysql/schema_26_down.sql b/SQL/mysql/schema_26_down.sql deleted file mode 100644 index e69de29bb2d..00000000000 From 66e2838196bb919639abfedf4e06490c6ff61109 Mon Sep 17 00:00:00 2001 From: darrell-k Date: Wed, 30 Jul 2025 23:38:45 +0100 Subject: [PATCH 5/6] SQL conflict Signed-off-by: darrell-k --- SQL/SQLite/schema_26_up.sql | 24 ------------------------ SQL/mysql/schema_26_up.sql | 24 ------------------------ 2 files changed, 48 deletions(-) delete mode 100644 SQL/SQLite/schema_26_up.sql delete mode 100644 SQL/mysql/schema_26_up.sql diff --git a/SQL/SQLite/schema_26_up.sql b/SQL/SQLite/schema_26_up.sql deleted file mode 100644 index 4cc56591895..00000000000 --- a/SQL/SQLite/schema_26_up.sql +++ /dev/null @@ -1,24 +0,0 @@ -ALTER TABLE albums ADD version blob; -ALTER TABLE tracks ADD lms_persistent_id text; -DROP INDEX IF EXISTS albumsLabelIndex; -CREATE INDEX albumsLabelIndex ON albums (label); -DROP TABLE IF EXISTS labels; -CREATE TABLE labels ( - id integer PRIMARY KEY AUTOINCREMENT, - name blob, - namesort text, - namesearch text -); -DROP TABLE IF EXISTS label_album; -CREATE TABLE label_album ( - label int(10), - album int(10), - PRIMARY KEY (label,album), - FOREIGN KEY (`album`) REFERENCES `albums` (`id`) ON DELETE CASCADE, - FOREIGN KEY (`label`) REFERENCES `labels` (`id`) ON DELETE CASCADE -); -DROP INDEX IF EXISTS label_albumAlbumIndex; -CREATE INDEX label_albumAlbumIndex ON label_album (album); -DROP INDEX IF EXISTS label_albumLabelIndex; -CREATE INDEX label_albumLabelIndex ON label_album (label); - diff --git a/SQL/mysql/schema_26_up.sql b/SQL/mysql/schema_26_up.sql deleted file mode 100644 index 4cc56591895..00000000000 --- a/SQL/mysql/schema_26_up.sql +++ /dev/null @@ -1,24 +0,0 @@ -ALTER TABLE albums ADD version blob; -ALTER TABLE tracks ADD lms_persistent_id text; -DROP INDEX IF EXISTS albumsLabelIndex; -CREATE INDEX albumsLabelIndex ON albums (label); -DROP TABLE IF EXISTS labels; -CREATE TABLE labels ( - id integer PRIMARY KEY AUTOINCREMENT, - name blob, - namesort text, - namesearch text -); -DROP TABLE IF EXISTS label_album; -CREATE TABLE label_album ( - label int(10), - album int(10), - PRIMARY KEY (label,album), - FOREIGN KEY (`album`) REFERENCES `albums` (`id`) ON DELETE CASCADE, - FOREIGN KEY (`label`) REFERENCES `labels` (`id`) ON DELETE CASCADE -); -DROP INDEX IF EXISTS label_albumAlbumIndex; -CREATE INDEX label_albumAlbumIndex ON label_album (album); -DROP INDEX IF EXISTS label_albumLabelIndex; -CREATE INDEX label_albumLabelIndex ON label_album (label); - From d15e4d2fd2936ffc41e914b61327122b972c1954 Mon Sep 17 00:00:00 2001 From: darrell-k Date: Wed, 30 Jul 2025 23:46:22 +0100 Subject: [PATCH 6/6] Remove unrelated new tracks table column Signed-off-by: darrell-k --- SQL/SQLite/schema_27_up.sql | 1 - SQL/mysql/schema_27_up.sql | 1 - 2 files changed, 2 deletions(-) diff --git a/SQL/SQLite/schema_27_up.sql b/SQL/SQLite/schema_27_up.sql index 4cc56591895..3e3cd9d3d2e 100644 --- a/SQL/SQLite/schema_27_up.sql +++ b/SQL/SQLite/schema_27_up.sql @@ -1,5 +1,4 @@ ALTER TABLE albums ADD version blob; -ALTER TABLE tracks ADD lms_persistent_id text; DROP INDEX IF EXISTS albumsLabelIndex; CREATE INDEX albumsLabelIndex ON albums (label); DROP TABLE IF EXISTS labels; diff --git a/SQL/mysql/schema_27_up.sql b/SQL/mysql/schema_27_up.sql index 4cc56591895..3e3cd9d3d2e 100644 --- a/SQL/mysql/schema_27_up.sql +++ b/SQL/mysql/schema_27_up.sql @@ -1,5 +1,4 @@ ALTER TABLE albums ADD version blob; -ALTER TABLE tracks ADD lms_persistent_id text; DROP INDEX IF EXISTS albumsLabelIndex; CREATE INDEX albumsLabelIndex ON albums (label); DROP TABLE IF EXISTS labels;