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
|
@ -221,7 +221,7 @@
|
|||
</index>
|
||||
</table>
|
||||
<table name="cc_schedule" phpName="CcSchedule">
|
||||
<column name="id" phpName="DbId" type="BIGINT" primaryKey="true" required="true"/>
|
||||
<column name="id" phpName="DbId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
|
||||
<column name="playlist_id" phpName="DbPlaylistId" type="INTEGER" required="true"/>
|
||||
<column name="starts" phpName="DbStarts" type="TIMESTAMP" required="true"/>
|
||||
<column name="ends" phpName="DbEnds" type="TIMESTAMP" required="true"/>
|
||||
|
@ -234,6 +234,10 @@
|
|||
<column name="cue_out" phpName="DbCueOut" type="TIME" required="false" defaultValue="00:00:00"/>
|
||||
<column name="schedule_group_played" phpName="DbScheduleGroupPlayed" type="BOOLEAN" required="false" defaultValue="0"/>
|
||||
<column name="media_item_played" phpName="DbMediaItemPlayed" type="BOOLEAN" required="false" defaultValue="0"/>
|
||||
<column name="instance_id" phpName="DbInstanceId" type="INTEGER" required="true"/>
|
||||
<foreign-key foreignTable="cc_show_instances" name="cc_show_inst_fkey" onDelete="CASCADE">
|
||||
<reference local="instance_id" foreign="id"/>
|
||||
</foreign-key>
|
||||
</table>
|
||||
<table name="cc_sess" phpName="CcSess">
|
||||
<column name="sessid" phpName="Sessid" type="CHAR" size="32" primaryKey="true" required="true"/>
|
||||
|
|
|
@ -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