free_sql('CREATE TABLE IF NOT EXISTS `foto_albums` ( `id` int(10) NOT NULL AUTO_INCREMENT, `user_id` varchar(255) DEFAULT NULL, `srok` varchar(30) DEFAULT NULL, `t` varchar(30) DEFAULT NULL, `naim` varchar(254) DEFAULT NULL, `reyt` int(10) DEFAULT 0, `img` varchar(15) DEFAULT NULL, `cena` int(6) DEFAULT NULL, `roznica` varchar(250) DEFAULT "1", `private` int(1) DEFAULT 0, `public` int(1) DEFAULT 1, `alias` varchar(250) DEFAULT NULL, `dostup` int(10) DEFAULT NULL, `pwd` text DEFAULT NULL, `json` longtext DEFAULT NULL, PRIMARY KEY (`id`), KEY `user_id` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;'); $this->free_sql('CREATE TABLE IF NOT EXISTS `foto_img` ( `id` int(10) NOT NULL AUTO_INCREMENT, `user_id` varchar(255) DEFAULT NULL, `private` int(1) DEFAULT 0, `album_id` int(10) DEFAULT NULL, `img` varchar(15) DEFAULT NULL, `tags` varchar(254) DEFAULT NULL, `reyt` int(10) DEFAULT 0, `downloads` int(10) DEFAULT NULL, `t` varchar(30) DEFAULT NULL, `naim` varchar(254) DEFAULT NULL, `audit` int(1) DEFAULT 0, `data_s` varchar(250) DEFAULT NULL, `size` varchar(20) DEFAULT NULL, `md5` varchar(100) DEFAULT NULL, `opis` longtext DEFAULT NULL, `t_info` varchar(250) DEFAULT NULL, `public` int(1) DEFAULT 1, `original_name` varchar(100) DEFAULT NULL, `json` longtext DEFAULT NULL, PRIMARY KEY (`id`), KEY `user_id` (`user_id`), KEY `album_id` (`album_id`), CONSTRAINT `foto_img_ibfk_2` FOREIGN KEY (`album_id`) REFERENCES `foto_albums` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;'); $this->free_sql2('CREATE TABLE IF NOT EXISTS `strana` ( `id` int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, `txt` varchar(300) NULL ) ENGINE="InnoDB";'); $this->free_sql2('CREATE TABLE IF NOT EXISTS `region` ( `id` int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, `txt` varchar(300) NULL, `strana_id` int(11) NULL, FOREIGN KEY (`strana_id`) REFERENCES `strana` (`id`) ) ENGINE="InnoDB";'); $this->free_sql2('CREATE TABLE IF NOT EXISTS `city` ( `id` int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, `txt` varchar(300) NULL, `region_id` int(11) NULL, `strana_id` int(11) NULL, FOREIGN KEY (`region_id`) REFERENCES `region` (`id`), FOREIGN KEY (`strana_id`) REFERENCES `strana` (`id`) ) ENGINE="InnoDB";'); $this->free_sql2('CREATE TABLE IF NOT EXISTS `cart` ( `id` int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, `kolvo` int(9) NULL, `t` varchar(30) NULL, `pages_id` int(11) NULL, `user_id` int(11) NULL, FOREIGN KEY (`pages_id`) REFERENCES `pages` (`id`), FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ) ENGINE="InnoDB";'); ?>