· 8 years ago · Aug 12, 2018, 07:58 PM
1CREATE TABLE IF NOT EXISTS `ser_info` (
2 `id` bigint(20) NOT NULL AUTO_INCREMENT,
3 `id_lang` smallint(6) NOT NULL,
4 `id_ser` bigint(20) NOT NULL,
5 `name` text NOT NULL,
6 `votes_up` bigint(20) DEFAULT NULL,
7 `votes_down` bigint(20) DEFAULT NULL,
8 `public` tinyint(4) DEFAULT NULL,
9 PRIMARY KEY (`id`),
10 KEY `fk_ser_info_1` (`id_ser`),
11 KEY `fk_ser_info_2` (`id_lang`)
12) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
13
14--
15-- Omezenà pro exportované tabulky
16--
17
18--
19-- Omezenà pro tabulku `ser_info`
20--
21ALTER TABLE `ser_info`
22 ADD CONSTRAINT `fk_ser_info_1` FOREIGN KEY (`id_ser`) REFERENCES `ser` (`id`) ON UPDATE CASCADE,
23 ADD CONSTRAINT `fk_ser_info_2` FOREIGN KEY (`id_lang`) REFERENCES `lang` (`id`) ON UPDATE CASCADE;