diff --git a/updates/20230613.php b/updates/20230613.php index 55e577d..7c0e240 100644 --- a/updates/20230613.php +++ b/updates/20230613.php @@ -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.