feat: replace php migration with django migration

- keep latest legacy version in initial migration file
- move propel schema to api legacy app
- remove legacy upgrade tool
This commit is contained in:
jo 2022-05-28 16:27:57 +02:00 committed by Kyle Robbertze
parent ee98387264
commit 0e4bc4cacd
85 changed files with 1005 additions and 1000 deletions

View file

@ -1,90 +0,0 @@
ALTER TABLE cc_files ADD COLUMN description VARCHAR(512);
-----------------------------------------------------------------------
-- podcast
-----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS "podcast"
(
"id" serial NOT NULL,
"url" VARCHAR(4096) 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,
PRIMARY KEY ("id")
);
-----------------------------------------------------------------------
-- station_podcast
-----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS "station_podcast"
(
"id" serial NOT NULL,
"podcast_id" INTEGER NOT NULL,
PRIMARY KEY ("id")
);
-----------------------------------------------------------------------
-- imported_podcast
-----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS "imported_podcast"
(
"id" serial NOT NULL,
"auto_ingest" BOOLEAN DEFAULT 'f' NOT NULL,
"auto_ingest_timestamp" TIMESTAMP,
"podcast_id" INTEGER NOT NULL,
PRIMARY KEY ("id")
);
-----------------------------------------------------------------------
-- podcast_episodes
-----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS "podcast_episodes"
(
"id" serial NOT NULL,
"file_id" INTEGER,
"podcast_id" INTEGER NOT NULL,
"publication_date" TIMESTAMP NOT NULL,
"download_url" VARCHAR(4096) NOT NULL,
"episode_guid" VARCHAR(4096) NOT NULL,
PRIMARY KEY ("id")
);
ALTER TABLE "podcast" ADD CONSTRAINT "podcast_owner_fkey"
FOREIGN KEY ("owner")
REFERENCES "cc_subjs" ("id")
ON DELETE CASCADE;
ALTER TABLE "station_podcast" ADD CONSTRAINT "podcast_id_fkey"
FOREIGN KEY ("podcast_id")
REFERENCES "podcast" ("id")
ON DELETE CASCADE;
ALTER TABLE "imported_podcast" ADD CONSTRAINT "podcast_id_fkey"
FOREIGN KEY ("podcast_id")
REFERENCES "podcast" ("id")
ON DELETE CASCADE;
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_episodes" ADD CONSTRAINT "podcast_episodes_podcast_id_fkey"
FOREIGN KEY ("podcast_id")
REFERENCES "podcast" ("id")
ON DELETE CASCADE;