changed how shows saved in database to make keeping track of host permissions easier.

This commit is contained in:
naomiaro 2010-12-10 12:15:17 -05:00
parent b10c2cfe2a
commit d94063fbe4
30 changed files with 6527 additions and 812 deletions

View file

@ -162,20 +162,56 @@ CREATE TABLE "cc_show"
(
"id" serial NOT NULL,
"name" VARCHAR(255) default '' NOT NULL,
"first_show" DATE NOT NULL,
"last_show" DATE,
"start_time" TIME NOT NULL,
"end_time" TIME NOT NULL,
"repeats" INT2 NOT NULL,
"day" INT2 NOT NULL,
"description" VARCHAR(512),
"show_id" INTEGER NOT NULL,
PRIMARY KEY ("id")
);
COMMENT ON TABLE "cc_show" IS '';
SET search_path TO public;
-----------------------------------------------------------------------------
-- cc_show_days
-----------------------------------------------------------------------------
DROP TABLE "cc_show_days" CASCADE;
CREATE TABLE "cc_show_days"
(
"id" serial NOT NULL,
"first_show" DATE NOT NULL,
"last_show" DATE,
"start_time" TIME NOT NULL,
"end_time" TIME NOT NULL,
"day" INT2 NOT NULL,
"show_id" INTEGER NOT NULL,
PRIMARY KEY ("id")
);
COMMENT ON TABLE "cc_show_days" IS '';
SET search_path TO public;
-----------------------------------------------------------------------------
-- cc_show_hosts
-----------------------------------------------------------------------------
DROP TABLE "cc_show_hosts" CASCADE;
CREATE TABLE "cc_show_hosts"
(
"id" serial NOT NULL,
"show_id" INTEGER NOT NULL,
"subjs_id" INTEGER NOT NULL,
PRIMARY KEY ("id")
);
COMMENT ON TABLE "cc_show_hosts" IS '';
SET search_path TO public;
-----------------------------------------------------------------------------
-- cc_playlist
@ -401,6 +437,12 @@ ALTER TABLE "cc_files" ADD CONSTRAINT "cc_files_editedby_fkey" FOREIGN KEY ("edi
ALTER TABLE "cc_perms" ADD CONSTRAINT "cc_perms_subj_fkey" FOREIGN KEY ("subj") REFERENCES "cc_subjs" ("id") ON DELETE CASCADE;
ALTER TABLE "cc_show_days" ADD CONSTRAINT "cc_show_fkey" FOREIGN KEY ("show_id") REFERENCES "cc_show" ("id") ON DELETE CASCADE;
ALTER TABLE "cc_show_hosts" ADD CONSTRAINT "cc_perm_show_fkey" FOREIGN KEY ("show_id") REFERENCES "cc_show" ("id") ON DELETE CASCADE;
ALTER TABLE "cc_show_hosts" ADD CONSTRAINT "cc_perm_host_fkey" FOREIGN KEY ("subjs_id") REFERENCES "cc_subjs" ("id") ON DELETE CASCADE;
ALTER TABLE "cc_playlist" ADD CONSTRAINT "cc_playlist_editedby_fkey" FOREIGN KEY ("editedby") REFERENCES "cc_subjs" ("id");
ALTER TABLE "cc_playlistcontents" ADD CONSTRAINT "cc_playlistcontents_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "cc_files" ("id") ON DELETE CASCADE;