CC-3683: Upgraded database not equivalent to fresh install database part 1

This commit is contained in:
Martin Konecny 2012-05-15 18:45:00 -04:00
parent 452c14fcb7
commit 4a85be79b8
1 changed files with 19 additions and 2 deletions

View File

@ -17,6 +17,13 @@ ALTER TABLE cc_files
ALTER TABLE cc_playlist ALTER TABLE cc_playlist
DROP CONSTRAINT cc_playlist_editedby_fkey; DROP CONSTRAINT cc_playlist_editedby_fkey;
CREATE SEQUENCE cc_live_log_id_seq
START WITH 1
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
CREATE SEQUENCE cc_subjs_token_id_seq CREATE SEQUENCE cc_subjs_token_id_seq
START WITH 1 START WITH 1
INCREMENT BY 1 INCREMENT BY 1
@ -24,6 +31,13 @@ CREATE SEQUENCE cc_subjs_token_id_seq
NO MINVALUE NO MINVALUE
CACHE 1; CACHE 1;
CREATE TABLE cc_live_log (
id integer DEFAULT nextval('cc_live_log_id_seq'::regclass) NOT NULL,
"state" character varying(32) NOT NULL,
start_time timestamp without time zone NOT NULL,
end_time timestamp without time zone
);
CREATE TABLE cc_subjs_token ( CREATE TABLE cc_subjs_token (
id integer DEFAULT nextval('cc_subjs_token_id_seq'::regclass) NOT NULL, id integer DEFAULT nextval('cc_subjs_token_id_seq'::regclass) NOT NULL,
user_id integer NOT NULL, user_id integer NOT NULL,
@ -35,8 +49,8 @@ CREATE TABLE cc_subjs_token (
ALTER TABLE cc_files ALTER TABLE cc_files
ADD COLUMN utime timestamp(6) without time zone, ADD COLUMN utime timestamp(6) without time zone,
ADD COLUMN lptime timestamp(6) without time zone, ADD COLUMN lptime timestamp(6) without time zone,
ADD COLUMN soundcloud_upload_time timestamp(6) without time zone,
ADD COLUMN file_exists boolean DEFAULT true, ADD COLUMN file_exists boolean DEFAULT true,
ADD COLUMN soundcloud_upload_time timestamp(6) without time zone,
ALTER COLUMN bit_rate TYPE integer USING airtime_to_int(bit_rate) /* TYPE change - table: cc_files original: character varying(32) new: integer */, ALTER COLUMN bit_rate TYPE integer USING airtime_to_int(bit_rate) /* TYPE change - table: cc_files original: character varying(32) new: integer */,
ALTER COLUMN sample_rate TYPE integer USING airtime_to_int(bit_rate) /* TYPE change - table: cc_files original: character varying(32) new: integer */, ALTER COLUMN sample_rate TYPE integer USING airtime_to_int(bit_rate) /* TYPE change - table: cc_files original: character varying(32) new: integer */,
ALTER COLUMN length TYPE interval /* TYPE change - table: cc_files original: time without time zone new: interval */, ALTER COLUMN length TYPE interval /* TYPE change - table: cc_files original: time without time zone new: interval */,
@ -80,7 +94,7 @@ ALTER TABLE cc_show
ADD COLUMN live_stream_using_custom_auth boolean DEFAULT false, ADD COLUMN live_stream_using_custom_auth boolean DEFAULT false,
ADD COLUMN live_stream_user character varying(255), ADD COLUMN live_stream_user character varying(255),
ADD COLUMN live_stream_pass character varying(255); ADD COLUMN live_stream_pass character varying(255);
ALTER TABLE cc_show_instances ALTER TABLE cc_show_instances
ADD COLUMN created timestamp without time zone, ADD COLUMN created timestamp without time zone,
ADD COLUMN last_scheduled timestamp without time zone, ADD COLUMN last_scheduled timestamp without time zone,
@ -92,6 +106,9 @@ UPDATE cc_show_instances SET created = now();
ALTER TABLE cc_show_instances ALTER TABLE cc_show_instances
ALTER COLUMN created SET NOT NULL; ALTER COLUMN created SET NOT NULL;
ALTER TABLE cc_live_log
ADD CONSTRAINT cc_live_log_pkey PRIMARY KEY (id);
ALTER TABLE cc_subjs_token ALTER TABLE cc_subjs_token
ADD CONSTRAINT cc_subjs_token_pkey PRIMARY KEY (id); ADD CONSTRAINT cc_subjs_token_pkey PRIMARY KEY (id);