diff --git a/db/migrations/0021.add_mivideo_fk.py b/db/migrations/0021.add_mivideo_fk.py new file mode 100644 index 0000000..75970cc --- /dev/null +++ b/db/migrations/0021.add_mivideo_fk.py @@ -0,0 +1,18 @@ +''' +Migration to add MiVideo table foreign key +''' + +from yoyo import step + +__depends__ = {'0016.add_mivideo_creation_tables'} + +steps = [ + step(''' + ALTER TABLE mivideo_media_courses + ADD CONSTRAINT fk_media_id + FOREIGN KEY (media_id) + REFERENCES mivideo_media_created(id) + ON UPDATE CASCADE + ON DELETE CASCADE; + '''), +]