thd/data/sql/schema.sql
author ymh <ymh.work@gmail.com>
Wed, 01 Jun 2016 14:07:43 +0200
changeset 103 d2af8a210f5d
parent 35 94a1dc255022
permissions -rw-r--r--
merge bundle
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
     1
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;
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
     2
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;
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
     3
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;
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
     4
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;
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
     5
ALTER TABLE thd_image ADD FOREIGN KEY (film_ref) REFERENCES thd_film(ref);
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
     6
ALTER TABLE thd_segment ADD FOREIGN KEY (video_ref) REFERENCES thd_video(ref);
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
     7
ALTER TABLE thd_video ADD FOREIGN KEY (film_ref) REFERENCES thd_film(ref);