bdd_wankil/sql/init.sql
rick dbfd1c0248
first commit
add backend, init script for SQL
2025-03-16 21:07:46 +01:00

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;