modified cc_schedule table, added foreign key to show instance id for easy clean up when show needs to be cleared/deleted. replaced primary key with a standard auto incrementing key for efficiency since the other key had no use.
This commit is contained in:
parent
14c71a3f39
commit
ebb43857f6
12 changed files with 766 additions and 45 deletions
|
@ -338,7 +338,7 @@ DROP TABLE "cc_schedule" CASCADE;
|
|||
|
||||
CREATE TABLE "cc_schedule"
|
||||
(
|
||||
"id" INT8 NOT NULL,
|
||||
"id" serial NOT NULL,
|
||||
"playlist_id" INTEGER NOT NULL,
|
||||
"starts" TIMESTAMP NOT NULL,
|
||||
"ends" TIMESTAMP NOT NULL,
|
||||
|
@ -351,6 +351,7 @@ CREATE TABLE "cc_schedule"
|
|||
"cue_out" TIME default '00:00:00',
|
||||
"schedule_group_played" BOOLEAN default 'f',
|
||||
"media_item_played" BOOLEAN default 'f',
|
||||
"instance_id" INTEGER NOT NULL,
|
||||
PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
|
@ -501,4 +502,6 @@ ALTER TABLE "cc_playlistcontents" ADD CONSTRAINT "cc_playlistcontents_playlist_i
|
|||
|
||||
ALTER TABLE "cc_pref" ADD CONSTRAINT "cc_pref_subjid_fkey" FOREIGN KEY ("subjid") REFERENCES "cc_subjs" ("id") ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE "cc_schedule" ADD CONSTRAINT "cc_show_inst_fkey" FOREIGN KEY ("instance_id") REFERENCES "cc_show_instances" ("id") ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE "cc_sess" ADD CONSTRAINT "cc_sess_userid_fkey" FOREIGN KEY ("userid") REFERENCES "cc_subjs" ("id") ON DELETE CASCADE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue