
diff -r d2af8a210f5d -r 8e4fe6f3337d thd/data/sql/schema.sql
--- a/thd/data/sql/schema.sql	Wed Jun 01 14:07:43 2016 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-CREATE TABLE thd_film (id INT, ref INT NOT NULL, title VARCHAR(255) NOT NULL, pitch TEXT NOT NULL, duration INT NOT NULL, directors TEXT NOT NULL, actors TEXT NOT NULL, slug_url VARCHAR(255) NOT NULL, original_title VARCHAR(255), production_year BIGINT, PRIMARY KEY(id)) ENGINE = INNODB;
-CREATE TABLE thd_image (id INT AUTO_INCREMENT, film_ref INT NOT NULL, type TINYINT NOT NULL, file VARCHAR(255) NOT NULL, INDEX film_ref_idx (film_ref), PRIMARY KEY(id)) ENGINE = INNODB;
-CREATE TABLE thd_segment (id INT AUTO_INCREMENT, title VARCHAR(255) NOT NULL, video_ref INT NOT NULL, start DOUBLE NOT NULL, end DOUBLE NOT NULL, user_id INT NOT NULL, creation_date DATETIME NOT NULL, INDEX video_ref_idx (video_ref), PRIMARY KEY(id)) ENGINE = INNODB;
-CREATE TABLE thd_video (id INT AUTO_INCREMENT, ref INT NOT NULL, film_ref INT NOT NULL, file VARCHAR(255) NOT NULL, title VARCHAR(255), INDEX ref_idx (ref), INDEX film_ref_idx (film_ref), PRIMARY KEY(id)) ENGINE = INNODB;
-ALTER TABLE thd_image ADD FOREIGN KEY (film_ref) REFERENCES thd_film(ref);
-ALTER TABLE thd_segment ADD FOREIGN KEY (video_ref) REFERENCES thd_video(ref);
-ALTER TABLE thd_video ADD FOREIGN KEY (film_ref) REFERENCES thd_film(ref);




