Bunch of schema changes

This commit is contained in:
drigato 2015-10-13 10:14:23 -04:00
parent c7dd2e7256
commit cfb21f8425
28 changed files with 1647 additions and 5494 deletions

View file

@ -563,7 +563,7 @@
</foreign-key>
</table>
<table name="podcast" phpName="Podcast" abstract="true">
<table name="podcast" phpName="Podcast">
<column name="id" phpName="DbId" primaryKey="true" type="INTEGER" autoIncrement="true" required="true" />
<column name="title" phpName="DbTitle" type="VARCHAR" size="4096" required="true" />
<column name="creator" phpName="DbCreator" type="VARCHAR" size="4096" />
@ -584,16 +584,26 @@
</table>
<table name="station_podcast" phpName="StationPodcast">
<behavior name="concrete_inheritance">
<parameter name="extends" value="podcast" />
<column name="id" phpName="DbId" required="true" primaryKey="true" autoIncrement="true" type="INTEGER"/>
<column name="podcast_id" phpName="DbPodcastId" required="true" type="INTEGER"/>
<foreign-key foreignTable="podcast" name="podcast_id_fkey" onDelete="CASCADE">
<reference local="podcast_id" foreign="id" />
</foreign-key>
<behavior name="delegate">
<parameter name="to" value="podcast" />
</behavior>
</table>
<table name="imported_podcast" phpName="ImportedPodcast">
<column name="id" phpName="DbId" required="true" primaryKey="true" autoIncrement="true" type="INTEGER"/>
<column name="url" phpName="DbUrl" type="VARCHAR" size="4096" required="true" />
<column name="auto_ingest" phpName="DbAutoIngest" type="BOOLEAN" required="true" defaultValue="false"/>
<behavior name="concrete_inheritance">
<parameter name="extends" value="podcast" />
<column name="podcast_id" phpName="DbPodcastId" required="true" type="INTEGER"/>
<foreign-key foreignTable="podcast" name="podcast_id_fkey" onDelete="CASCADE">
<reference local="podcast_id" foreign="id" />
</foreign-key>
<behavior name="delegate">
<parameter name="to" value="podcast" />
</behavior>
</table>

View file

@ -729,7 +729,6 @@ CREATE TABLE "podcast"
"itunes_category" VARCHAR(4096),
"itunes_explicit" VARCHAR(4096),
"owner" INTEGER,
"descendant_class" VARCHAR(100),
PRIMARY KEY ("id")
);
@ -741,20 +740,8 @@ DROP TABLE IF EXISTS "station_podcast" CASCADE;
CREATE TABLE "station_podcast"
(
"id" INTEGER NOT NULL,
"title" VARCHAR(4096) NOT NULL,
"creator" VARCHAR(4096),
"description" VARCHAR(4096),
"language" VARCHAR(4096),
"copyright" VARCHAR(4096),
"link" VARCHAR(4096),
"itunes_author" VARCHAR(4096),
"itunes_keywords" VARCHAR(4096),
"itunes_summary" VARCHAR(4096),
"itunes_subtitle" VARCHAR(4096),
"itunes_category" VARCHAR(4096),
"itunes_explicit" VARCHAR(4096),
"owner" INTEGER,
"id" serial NOT NULL,
"podcast_id" INTEGER NOT NULL,
PRIMARY KEY ("id")
);
@ -766,22 +753,10 @@ DROP TABLE IF EXISTS "imported_podcast" CASCADE;
CREATE TABLE "imported_podcast"
(
"id" serial NOT NULL,
"url" VARCHAR(4096) NOT NULL,
"auto_ingest" BOOLEAN DEFAULT 'f' NOT NULL,
"id" INTEGER NOT NULL,
"title" VARCHAR(4096) NOT NULL,
"creator" VARCHAR(4096),
"description" VARCHAR(4096),
"language" VARCHAR(4096),
"copyright" VARCHAR(4096),
"link" VARCHAR(4096),
"itunes_author" VARCHAR(4096),
"itunes_keywords" VARCHAR(4096),
"itunes_summary" VARCHAR(4096),
"itunes_subtitle" VARCHAR(4096),
"itunes_category" VARCHAR(4096),
"itunes_explicit" VARCHAR(4096),
"owner" INTEGER,
"podcast_id" INTEGER NOT NULL,
PRIMARY KEY ("id")
);
@ -979,26 +954,16 @@ ALTER TABLE "podcast" ADD CONSTRAINT "podcast_owner_fkey"
REFERENCES "cc_subjs" ("id")
ON DELETE CASCADE;
ALTER TABLE "station_podcast" ADD CONSTRAINT "station_podcast_FK_1"
FOREIGN KEY ("id")
ALTER TABLE "station_podcast" ADD CONSTRAINT "podcast_id_fkey"
FOREIGN KEY ("podcast_id")
REFERENCES "podcast" ("id")
ON DELETE CASCADE;
ALTER TABLE "station_podcast" ADD CONSTRAINT "station_podcast_FK_2"
FOREIGN KEY ("owner")
REFERENCES "cc_subjs" ("id")
ON DELETE CASCADE;
ALTER TABLE "imported_podcast" ADD CONSTRAINT "imported_podcast_FK_1"
FOREIGN KEY ("id")
ALTER TABLE "imported_podcast" ADD CONSTRAINT "podcast_id_fkey"
FOREIGN KEY ("podcast_id")
REFERENCES "podcast" ("id")
ON DELETE CASCADE;
ALTER TABLE "imported_podcast" ADD CONSTRAINT "imported_podcast_FK_2"
FOREIGN KEY ("owner")
REFERENCES "cc_subjs" ("id")
ON DELETE CASCADE;
ALTER TABLE "podcast_episodes" ADD CONSTRAINT "podcast_episodes_cc_files_fkey"
FOREIGN KEY ("file_id")
REFERENCES "cc_files" ("id")