diff --git a/install_minimal/upgrades/airtime-2.1.0/DbUpgrade.php b/install_minimal/upgrades/airtime-2.1.0/DbUpgrade.php index db6f355d2..62ff50243 100644 --- a/install_minimal/upgrades/airtime-2.1.0/DbUpgrade.php +++ b/install_minimal/upgrades/airtime-2.1.0/DbUpgrade.php @@ -22,6 +22,14 @@ class AirtimeDatabaseUpgrade{ $dir = __DIR__; passthru("export PGPASSWORD=$password && psql -h $host -U $username -q -f $dir/data/upgrade.sql $database 2>&1 | grep -v \"will create implicit index\""); + + $sql = "SELECT id from cc_subjs WHERE type = 'A' LIMIT 1;"; + $result = UpgradeCommon::queryDb($sql); + $admin_id = $result->fetchColumn(0); + + $sql = "UPDATE cc_playlist SET creator_id = $admin_id"; + echo $sql.PHP_EOL; + UpgradeCommon::queryDb($sql); $sql = "INSERT INTO cc_pref(keystr, valstr) VALUES('scheduled_play_switch', 'on')"; UpgradeCommon::queryDb($sql); diff --git a/install_minimal/upgrades/airtime-2.1.0/data/upgrade.sql b/install_minimal/upgrades/airtime-2.1.0/data/upgrade.sql index c7b85d4f0..db388ff6f 100644 --- a/install_minimal/upgrades/airtime-2.1.0/data/upgrade.sql +++ b/install_minimal/upgrades/airtime-2.1.0/data/upgrade.sql @@ -68,6 +68,8 @@ ALTER TABLE cc_playlist ADD COLUMN utime timestamp(6) without time zone, ADD COLUMN creator_id integer, ADD COLUMN length interval DEFAULT '00:00:00'::interval; + +UPDATE cc_playlist SET utime = mtime; ALTER TABLE cc_playlistcontents ALTER COLUMN cliplength TYPE interval /* TYPE change - table: cc_playlistcontents original: time without time zone new: interval */,