Skip to content

Commit

Permalink
Drop existing Ampache sessions on the v1.9.0 update
Browse files Browse the repository at this point in the history
The schema of the sessions table has changed.
  • Loading branch information
paulijar committed Oct 1, 2023
1 parent 26bf489 commit dc7c238
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/Migration/PreMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* later. See the COPYING file.
*
* @author Pauli Järvinen <[email protected]>
* @copyright Pauli Järvinen 2017
* @copyright Pauli Järvinen 2017 - 2023
*/

namespace OCA\Music\Migration;
Expand Down Expand Up @@ -51,10 +51,6 @@ public function run(IOutput $output) {
// fulfill the new schema.
$tablesToErase = [];

if (\version_compare($installedVersion, '0.3.12', '<')) {
$tablesToErase[] = 'music_ampache_sessions';
}

if (\version_compare($installedVersion, '0.3.16.1', '<')) {
$tablesToErase[] = 'music_artists';
$tablesToErase[] = 'music_albums';
Expand All @@ -66,6 +62,10 @@ public function run(IOutput $output) {
$tablesToErase[] = 'music_bookmarks';
}

if (\version_compare($installedVersion, '1.9.0', '<')) {
$tablesToErase[] = 'music_ampache_sessions';
}

// Invalidate the cache on each update (if there is one).
// This might not be strictly necessary on all migrations, but it will do no harm.
$tablesToErase[] = 'music_cache';
Expand Down

0 comments on commit dc7c238

Please sign in to comment.