core/api/modules/lk/install_MYSQL.php

38 lines
1.1 KiB
PHP
Raw Normal View History

2022-12-11 13:55:49 +05:00
<?php
$this->free_sql2('CREATE TABLE IF NOT EXISTS `org` (
`id` int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`txt` varchar(300) NULL,
`br` varchar(300) NULL,
`vid` varchar(300) NULL,
`inn` varchar(15) NULL,
`kpp` varchar(15) NULL,
`pok` varchar(15) NULL,
`prod` varchar(15) NULL
) ENGINE="InnoDB";');
$this->free_sql2('CREATE TABLE IF NOT EXISTS `adres_dostavki` (
`id` int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`user_id` int(11) NULL,
`city_id` int(11) NULL,
`region_id` int(11) NULL,
`street` varchar(11) NULL,
`dom` varchar(11) NULL,
FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
FOREIGN KEY (`region_id`) REFERENCES `region` (`id`),
FOREIGN KEY (`city_id`) REFERENCES `city` (`id`)
) ENGINE="InnoDB";');
$this->free_sql2('CREATE TABLE IF NOT EXISTS `order` (
`id` int(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`txt` longtext DEFAULT NULL,
`t` varchar(30) NULL,
`user_id` int(11) NULL,
`status` int(1) NULL,
`adres_dostavki` int(10) NULL,
FOREIGN KEY (`adres_dostavki`) REFERENCES `adres_dostavki` (`id`)
) ENGINE="InnoDB";');
?>