SAAS-1058: Podcast table schema

SAAS-1059: Add description field to cc_files
This commit is contained in:
drigato 2015-09-14 17:00:54 -04:00
parent 2d2ed25fcc
commit 28493497fd
32 changed files with 7660 additions and 18 deletions

View file

@ -83,6 +83,7 @@
<column name="is_scheduled" phpName="DbIsScheduled" type="BOOLEAN" defaultValue="false"/>
<column name="is_playlist" phpName="DbIsPlaylist" type="BOOLEAN" defaultValue="false"/>
<column name="filesize" phpName="DbFilesize" type="Integer" required="true" defaultValue="0"/>
<column name="description" phpName="DbDescription" type="VARCHAR" size="512" />
<foreign-key foreignTable="cc_subjs" phpName="FkOwner" name="cc_files_owner_fkey">
<reference local="owner_id" foreign="id"/>
</foreign-key>
@ -561,4 +562,30 @@
<reference local="track_reference" foreign="id"/>
</foreign-key>
</table>
<table name="podcast" phpName="Podcast">
<column name="id" phpName="DbId" primaryKey="true" type="INTEGER" autoIncrement="true" required="true" />
<column name="url" phpName="DbUrl" type="VARCHAR" size="256" required="true" />
<column name="title" phpName="DbTitle" type="VARCHAR" size="256" required="true" />
<column name="creator" phpName="DbCreator" type="VARCHAR" size="256" />
<column name="description" phpName="DbDescription" type="VARCHAR" size="512" />
<column name="auto_ingest" phpName="DbAutoIngest" type="BOOLEAN" required="true" defaultValue="false"/>
<column name="owner" phpName="DbOwner" type="INTEGER" />
<foreign-key foreignTable="cc_subjs" name="podcast_owner_fkey" onDelete="CASCADE">
<reference local="owner" foreign="id" />
</foreign-key>
</table>
<table name="podcast_contents" phpName="PodcastContents">
<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">
<reference local="file_id" foreign="id" />
</foreign-key>
<foreign-key foreignTable="podcast" name="podcast_contents_podcast_id_fkey" onDelete="CASCADE">
<reference local="podcast_id" foreign="id" />
</foreign-key>
</table>
</database>

View file

@ -95,6 +95,7 @@ CREATE TABLE "cc_files"
"is_scheduled" BOOLEAN DEFAULT 'f',
"is_playlist" BOOLEAN DEFAULT 'f',
"filesize" INTEGER DEFAULT 0 NOT NULL,
"description" VARCHAR(512),
PRIMARY KEY ("id")
);
@ -706,6 +707,39 @@ CREATE TABLE "celery_tasks"
CONSTRAINT "id_unique" UNIQUE ("id")
);
-----------------------------------------------------------------------
-- podcast
-----------------------------------------------------------------------
DROP TABLE IF EXISTS "podcast" CASCADE;
CREATE TABLE "podcast"
(
"id" serial NOT NULL,
"url" VARCHAR(256) NOT NULL,
"title" VARCHAR(256) NOT NULL,
"creator" VARCHAR(256),
"description" VARCHAR(512),
"auto_ingest" BOOLEAN DEFAULT 'f' NOT NULL,
"owner" INTEGER,
PRIMARY KEY ("id")
);
-----------------------------------------------------------------------
-- podcast_contents
-----------------------------------------------------------------------
DROP TABLE IF EXISTS "podcast_contents" CASCADE;
CREATE TABLE "podcast_contents"
(
"id" serial NOT NULL,
"file_id" INTEGER NOT NULL,
"podcast_id" INTEGER NOT NULL,
"publication_date" TIMESTAMP NOT NULL,
PRIMARY KEY ("id")
);
ALTER TABLE "cc_files" ADD CONSTRAINT "cc_files_owner_fkey"
FOREIGN KEY ("owner_id")
REFERENCES "cc_subjs" ("id");
@ -877,3 +911,18 @@ ALTER TABLE "celery_tasks" ADD CONSTRAINT "celery_service_fkey"
FOREIGN KEY ("track_reference")
REFERENCES "third_party_track_references" ("id")
ON DELETE CASCADE;
ALTER TABLE "podcast" ADD CONSTRAINT "podcast_owner_fkey"
FOREIGN KEY ("owner")
REFERENCES "cc_subjs" ("id")
ON DELETE CASCADE;
ALTER TABLE "podcast_contents" ADD CONSTRAINT "podcast_contents_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"
FOREIGN KEY ("podcast_id")
REFERENCES "podcast" ("id")
ON DELETE CASCADE;