core/set/install/tovar_show_mysql.php

92 lines
3.2 KiB
PHP

<?php
\DB::set("CREATE TABLE IF NOT EXISTS `tovar` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`title` varchar(300) DEFAULT NULL,
`txt` longtext DEFAULT NULL,
`keywords` longtext DEFAULT NULL,
`artikul` varchar(50) DEFAULT NULL,
`description` longtext DEFAULT NULL,
`tovar_id_1c` varchar(100) DEFAULT NULL,
`tovar_cat_1c` varchar(100) DEFAULT NULL,
`status` int(1) DEFAULT NULL,
`category` int(10) DEFAULT NULL,
`countImg` int(2) DEFAULT NULL,
`partner` varchar(100) DEFAULT NULL,
`json` longtext DEFAULT NULL,
`brand_id` int(10) DEFAULT NULL,
`check_img` int(1) DEFAULT NULL,
`code` varchar(30) DEFAULT NULL,
`linkimg` longtext DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;");
\DB::set("CREATE TABLE IF NOT EXISTS `cart` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`kolvo` int(9) DEFAULT NULL,
`t` varchar(30) DEFAULT NULL,
`tovar_id` int(10) DEFAULT NULL,
`user_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `tovar_id` (`tovar_id`),
CONSTRAINT `cart_ibfk_1` FOREIGN KEY (`tovar_id`) REFERENCES `tovar` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;");
\DB::set("CREATE TABLE IF NOT EXISTS `tovar_barcode` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`barcode` varchar(20) DEFAULT NULL,
`tovar_id` int(10) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `tovar_id` (`tovar_id`),
CONSTRAINT `tovar_barcode_ibfk_2` FOREIGN KEY (`tovar_id`) REFERENCES `tovar` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;");
\DB::set("CREATE TABLE IF NOT EXISTS `tovar_har_sp`(
`id` int(11) NOT NULL AUTO_INCREMENT,
`txt` varchar(200) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;");
\DB::set("CREATE TABLE IF NOT EXISTS `tovar_har` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`tovar_har_sp_id` int(11) DEFAULT NULL,
`tovar_id` int(10) DEFAULT NULL,
`txt` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `tovar_har_sp_id` (`tovar_har_sp_id`),
KEY `tovar_id` (`tovar_id`),
CONSTRAINT `tovar_har_ibfk_1` FOREIGN KEY (`tovar_har_sp_id`) REFERENCES `tovar_har_sp` (`id`),
CONSTRAINT `tovar_har_ibfk_2` FOREIGN KEY (`tovar_id`) REFERENCES `tovar` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;");
\DB::set("CREATE TABLE IF NOT EXISTS `tovar_otzyv` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`user_id` int(10) NOT NULL,
`t` varchar(30) NOT NULL,
`txt` longtext NOT NULL,
`tovar_id` int(10) NOT NULL,
`status` int(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`),
KEY `tovar_id` (`tovar_id`),
CONSTRAINT `tovar_otzyv_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
CONSTRAINT `tovar_otzyv_ibfk_2` FOREIGN KEY (`tovar_id`) REFERENCES `tovar` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;");
\DB::set("CREATE TABLE IF NOT EXISTS `tovar_history` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`session_id` varchar(30) DEFAULT NULL,
`tovar_id` int(10) DEFAULT NULL,
`t` varchar(30) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `tovar_id` (`tovar_id`),
CONSTRAINT `tovar_history_ibfk_1` FOREIGN KEY (`tovar_id`) REFERENCES `tovar` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;");
?>