Skip to content

Commit

Permalink
Fix for update 20230613.php
Browse files Browse the repository at this point in the history
Had an issue that was affecting the database update for mysql, current code is specific to mariadb. Updated code should work for both mysql and mariadb.
  • Loading branch information
Postkassi authored Oct 23, 2024
1 parent 76f0692 commit 3315d85
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions updates/20230613.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ public function items()
public function run()
{
// Add a file location column to playlists to use when storing thumbnails.
$this->db->query('ALTER TABLE `playlists` ADD COLUMN IF NOT EXISTS `file_location` VARCHAR(2) NOT NULL AFTER `name`;');
if ($this->db->error()) {
return false;
if (! $this->db->column_exists('playlists', 'file_location')) {
$this->db->query('ALTER TABLE `playlists` ADD COLUMN `file_location` VARCHAR(2) NOT NULL AFTER `name`;');
if ($this->db->error()) {
echo $this->db->error(); //Debug output
return false;
}
}

// Add a random location to all previously existing playlists and create their directories.
Expand Down

0 comments on commit 3315d85

Please sign in to comment.