22 lines
445 B
SQL
22 lines
445 B
SQL
USE db;
|
|
|
|
CREATE TABLE `video` (
|
|
`id` INTEGER NOT NULL AUTO_INCREMENT UNIQUE,
|
|
`url` VARCHAR(16) UNIQUE,
|
|
PRIMARY KEY(`id`)
|
|
);
|
|
|
|
|
|
CREATE TABLE `subtitle` (
|
|
`id` INTEGER NOT NULL AUTO_INCREMENT UNIQUE,
|
|
`timecode` INTEGER,
|
|
`subtitle` TEXT(65535),
|
|
`video` INTEGER,
|
|
PRIMARY KEY(`id`),
|
|
FULLTEXT INDEX subtext(subtitle)
|
|
);
|
|
|
|
|
|
ALTER TABLE `subtitle`
|
|
ADD FOREIGN KEY(`video`) REFERENCES `video`(`id`)
|
|
ON UPDATE NO ACTION ON DELETE NO ACTION;
|