SAAS-1058: Podcast table schema

Renamed podcast_contents to podcast_episodes
Added new columns to podcast_episodes table
This commit is contained in:
drigato 2015-09-18 09:51:44 -04:00
parent f6f23864ce
commit 9a2e9d1b3b
18 changed files with 889 additions and 637 deletions

View file

@ -577,15 +577,17 @@
</foreign-key>
</table>
<table name="podcast_contents" phpName="PodcastContents">
<table name="podcast_episodes" phpName="PodcastEpisodes">
<column name="id" phpName="DbId" primaryKey="true" type="INTEGER" autoIncrement="true" required="true" />
<column name="file_id" phpName="DbFileId" type="INTEGER" required="true" />
<column name="podcast_id" phpName="DbPodcastId" type="INTEGER" required="true" />
<column name="publication_date" phpName="DbPublicationDate" type="TIMESTAMP" required="true" />
<foreign-key foreignTable="cc_files" name="podcast_contents_cc_files_fkey" onDelete="CASCADE">
<column name="download_url" phpName="DbDownloadUrl" type="varchar" size="512" required="true" />
<column name="episode_guid" phpName="DbEpisodeGuid" type="varchar" size="512" required="true" />
<foreign-key foreignTable="cc_files" name="podcast_episodes_cc_files_fkey" onDelete="CASCADE">
<reference local="file_id" foreign="id" />
</foreign-key>
<foreign-key foreignTable="podcast" name="podcast_contents_podcast_id_fkey" onDelete="CASCADE">
<foreign-key foreignTable="podcast" name="podcast_episodes_podcast_id_fkey" onDelete="CASCADE">
<reference local="podcast_id" foreign="id" />
</foreign-key>
</table>

View file

@ -727,17 +727,19 @@ CREATE TABLE "podcast"
);
-----------------------------------------------------------------------
-- podcast_contents
-- podcast_episodes
-----------------------------------------------------------------------
DROP TABLE IF EXISTS "podcast_contents" CASCADE;
DROP TABLE IF EXISTS "podcast_episodes" CASCADE;
CREATE TABLE "podcast_contents"
CREATE TABLE "podcast_episodes"
(
"id" serial NOT NULL,
"file_id" INTEGER NOT NULL,
"podcast_id" INTEGER NOT NULL,
"publication_date" TIMESTAMP NOT NULL,
"download_url" VARCHAR(512) NOT NULL,
"episode_guid" VARCHAR(512) NOT NULL,
PRIMARY KEY ("id")
);
@ -918,12 +920,12 @@ ALTER TABLE "podcast" ADD CONSTRAINT "podcast_owner_fkey"
REFERENCES "cc_subjs" ("id")
ON DELETE CASCADE;
ALTER TABLE "podcast_contents" ADD CONSTRAINT "podcast_contents_cc_files_fkey"
ALTER TABLE "podcast_episodes" ADD CONSTRAINT "podcast_episodes_cc_files_fkey"
FOREIGN KEY ("file_id")
REFERENCES "cc_files" ("id")
ON DELETE CASCADE;
ALTER TABLE "podcast_contents" ADD CONSTRAINT "podcast_contents_podcast_id_fkey"
ALTER TABLE "podcast_episodes" ADD CONSTRAINT "podcast_episodes_podcast_id_fkey"
FOREIGN KEY ("podcast_id")
REFERENCES "podcast" ("id")
ON DELETE CASCADE;