From 3ca8fe87876ce701b2754bcb05813d7b89f4b90a Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Wed, 29 Aug 2012 15:17:14 -0400 Subject: [PATCH] updated upgrade.sql for owner_id --- install_minimal/upgrades/airtime-2.2.0/data/upgrade.sql | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/install_minimal/upgrades/airtime-2.2.0/data/upgrade.sql b/install_minimal/upgrades/airtime-2.2.0/data/upgrade.sql index 6d08eec03..1f5cf72de 100644 --- a/install_minimal/upgrades/airtime-2.2.0/data/upgrade.sql +++ b/install_minimal/upgrades/airtime-2.2.0/data/upgrade.sql @@ -104,6 +104,7 @@ CREATE TABLE cc_webstream_metadata ( ALTER TABLE cc_files DROP COLUMN gunid, ADD COLUMN replay_gain character varying(16), + ADD COLUMN owner_id integer; ALTER COLUMN bpm TYPE integer using airtime_to_int(bpm) /* TYPE change - table: cc_files original: character varying(8) new: integer */; ALTER TABLE cc_playlistcontents @@ -154,3 +155,9 @@ ALTER TABLE cc_webstream_metadata ADD CONSTRAINT cc_schedule_inst_fkey FOREIGN KEY (instance_id) REFERENCES cc_schedule(id) ON DELETE CASCADE; DROP FUNCTION airtime_to_int(chartoconvert character varying); + +UPDATE cc_files +SET owner_id=(SELECT id FROM cc_subjs WHERE type='A' LIMIT 1) +WHERE owner_id is NULL + +