2022-12-17 18:15:09 +05:00
|
|
|
<?php
|
|
|
|
|
2023-01-07 18:55:55 +05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `site_speed` (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`t` TEXT,
|
|
|
|
`mod` TEXT,
|
|
|
|
`mod_id` TEXT,
|
|
|
|
`user_id` TEXT,
|
|
|
|
`speed` TEXT)");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `sitemap` (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`t` TEXT,
|
|
|
|
`link` TEXT,
|
|
|
|
`status` TEXT)");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-12-17 18:15:09 +05:00
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `users` (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`login` TEXT,
|
|
|
|
`email` TEXT,
|
|
|
|
`pwd` TEXT,
|
|
|
|
`act` TEXT,
|
|
|
|
`actcode` TEXT,
|
|
|
|
`lostdata` TEXT,
|
|
|
|
`ref` TEXT,
|
|
|
|
`ava` TEXT,
|
|
|
|
`balans` TEXT,
|
|
|
|
`fio` TEXT,
|
|
|
|
`about` TEXT,
|
|
|
|
`reyt` TEXT,
|
|
|
|
`tip` TEXT,
|
|
|
|
`dostup` TEXT,
|
|
|
|
`resurs` TEXT
|
|
|
|
)");
|
2023-01-02 21:33:36 +05:00
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `tasks` (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`user_id` INTEGER,
|
|
|
|
`isp_id` INTEGER,
|
|
|
|
`mod` TEXT,
|
|
|
|
`task` TEXT,
|
|
|
|
`t` TEXT,
|
|
|
|
`srok` TEXT,
|
|
|
|
`status` INTEGER,
|
|
|
|
FOREIGN KEY (`user_id`) REFERENCES `users` (`id`), FOREIGN KEY (`isp_id`) REFERENCES `users` (`id`) )");
|
|
|
|
|
2023-01-07 18:55:55 +05:00
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-19 21:07:48 +05:00
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `rss` (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`user_id` INTEGER,
|
|
|
|
`link` TEXT,
|
|
|
|
`rss` TEXT,
|
|
|
|
`txt` TEXT,
|
|
|
|
`srok` TEXT,
|
|
|
|
`partner` TEXT,
|
|
|
|
|
|
|
|
FOREIGN KEY (`user_id`) REFERENCES `users` (`id`));");
|
2023-01-07 18:55:55 +05:00
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-02 21:33:36 +05:00
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS 'docs' ('id' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, 't' TEXT, 'tip' TEXT, 'json' TEXT, 'user_id' INTEGER, `status` INTEGER, `comment` TEXT)");
|
2022-12-17 18:15:09 +05:00
|
|
|
|
2022-12-24 21:12:23 +05:00
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `userOption` (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`user_id` INTEGER,
|
|
|
|
`perevozka` INTEGER,
|
|
|
|
`remont` INTEGER,
|
|
|
|
`opt` INTEGER,
|
|
|
|
`roznica` INTEGER,
|
|
|
|
`proizv` INTEGER,
|
|
|
|
`org` INTEGER,
|
|
|
|
FOREIGN KEY (`user_id`) REFERENCES `users` (`id`));");
|
|
|
|
|
2022-12-17 18:15:09 +05:00
|
|
|
|
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `settings` (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`mod` TEXT,
|
|
|
|
`json` TEXT,
|
|
|
|
`resurs` TEXT
|
|
|
|
)");
|
|
|
|
|
2023-01-02 21:33:36 +05:00
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `meta` (
|
|
|
|
`id` INTEGER,
|
|
|
|
`mod` TEXT,
|
|
|
|
`keywords` TEXT,
|
|
|
|
`description` TEXT
|
|
|
|
)");
|
2022-12-17 18:15:09 +05:00
|
|
|
|
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `strana` (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`txt` TEXT
|
|
|
|
);");
|
|
|
|
|
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `region` (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
2023-02-12 15:08:07 +05:00
|
|
|
`txt` TEXT,
|
2022-12-17 18:15:09 +05:00
|
|
|
`strana_id` INTEGER,
|
|
|
|
FOREIGN KEY (`strana_id`) REFERENCES `strana` (`id`));");
|
|
|
|
|
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `city` (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
2023-02-12 15:08:07 +05:00
|
|
|
`txt` TEXT,
|
2022-12-17 18:15:09 +05:00
|
|
|
`region_id` INTEGER,
|
|
|
|
`strana_id` INTEGER,
|
|
|
|
FOREIGN KEY (`strana_id`) REFERENCES `strana` (`id`),
|
|
|
|
FOREIGN KEY (`region_id`) REFERENCES `region` (`id`));");
|
|
|
|
|
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `blog_category` (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`title` TEXT,
|
|
|
|
`keywords` TEXT,
|
|
|
|
`description` TEXT,
|
|
|
|
`status` TEXT,
|
|
|
|
`category` INTEGER,
|
|
|
|
`user_id` TEXT,
|
|
|
|
FOREIGN KEY (`user_id`) REFERENCES `users` (`id`));");
|
|
|
|
|
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `blog` (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`title` TEXT,
|
|
|
|
`txt` TEXT,
|
|
|
|
`t` TEXT,
|
|
|
|
`keywords` TEXT,
|
|
|
|
`alias` TEXT,
|
|
|
|
`description` TEXT,
|
|
|
|
`status` TEXT,
|
|
|
|
`category` INTEGER,
|
|
|
|
`user_id` INTEGER,
|
|
|
|
`reyt` INTEGER,
|
|
|
|
FOREIGN KEY (`user_id`) REFERENCES `users` (`id`));");
|
|
|
|
|
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `pages_category` (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`title` TEXT,
|
|
|
|
`status` TEXT,
|
|
|
|
`category` INTEGER,
|
|
|
|
`user_id` INTEGER,
|
|
|
|
`reyt` INTEGER,
|
|
|
|
FOREIGN KEY (`user_id`) REFERENCES `users` (`id`));");
|
|
|
|
|
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `pages_category_img` (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`title` TEXT,
|
|
|
|
`img` TEXT,
|
|
|
|
`original` TEXT,
|
|
|
|
`status` TEXT,
|
|
|
|
`category` INTEGER,
|
|
|
|
`user_id` INTEGER,
|
|
|
|
FOREIGN KEY (`category`) REFERENCES `pages_category` (`id`),
|
|
|
|
FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
|
|
|
|
|
|
|
|
);");
|
|
|
|
|
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `pages` (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`title` TEXT,
|
|
|
|
`txt` TEXT,
|
|
|
|
`t` TEXT,
|
|
|
|
`alias` TEXT,
|
|
|
|
`status` TEXT,
|
|
|
|
`category` INTEGER,
|
2023-02-19 21:07:48 +05:00
|
|
|
`comment` INTEGER,
|
2022-12-17 18:15:09 +05:00
|
|
|
`user_id` INTEGER,
|
|
|
|
FOREIGN KEY (`user_id`) REFERENCES `users` (`id`));");
|
|
|
|
|
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `org` (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`txt` TEXT,
|
|
|
|
`inn` TEXT,
|
|
|
|
`vid` TEXT,
|
|
|
|
`kpp` TEXT,
|
|
|
|
`ogrn` TEXT
|
|
|
|
);");
|
|
|
|
|
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `markets` (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`txt` TEXT,
|
|
|
|
`tip` TEXT,
|
|
|
|
`city_id` INTEGER,
|
|
|
|
`org_id` INTEGER,
|
|
|
|
`dom` TEXT,
|
|
|
|
`dostavka` INTEGER,
|
2023-02-12 15:08:07 +05:00
|
|
|
FOREIGN KEY (`city_id`) REFERENCES `txt` (`city`),
|
2022-12-17 18:15:09 +05:00
|
|
|
FOREIGN KEY (`org_id`) REFERENCES `org` (`city`));");
|
2022-12-17 19:10:16 +05:00
|
|
|
|
2023-01-02 21:33:36 +05:00
|
|
|
|
|
|
|
|
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `tovar` (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`title` TEXT,
|
|
|
|
`txt` TEXT,
|
|
|
|
`keywords` TEXT,
|
|
|
|
`artikul` TEXT,
|
|
|
|
`description` TEXT,
|
|
|
|
`tovar_id_1c` TEXT,
|
|
|
|
`tovar_cat_1c` TEXT,
|
|
|
|
`status` INTEGER,
|
|
|
|
`category` INTEGER ,
|
|
|
|
`countImg` INTEGER,
|
|
|
|
`partner` INTEGER,
|
|
|
|
`json` TEXT,
|
|
|
|
`brand_id` INTEGER,
|
|
|
|
`check_img` INTEGER,
|
|
|
|
`code` TEXT);");
|
|
|
|
|
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `tovar_category` (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`title` TEXT,
|
2023-01-07 18:55:55 +05:00
|
|
|
`description` TEXT,
|
|
|
|
`keywords` TEXT,
|
2023-01-02 21:33:36 +05:00
|
|
|
`status` INTEGER,
|
|
|
|
`category` INTEGER );");
|
|
|
|
|
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `zametka` ( `user_id` INTEGER NOT NULL, `txt` TEXT, FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) )");
|
|
|
|
|
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `tovar_category_img` (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`filename` TEXT,
|
|
|
|
`tovar_category_id` INTEGER,
|
|
|
|
`md5` TEXT,
|
2023-01-07 18:55:55 +05:00
|
|
|
`title` TEXT,
|
|
|
|
`alt` TEXT,
|
2023-01-02 21:33:36 +05:00
|
|
|
FOREIGN KEY (`tovar_category_id`) REFERENCES `tovar_category` (`id`));");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `tovar_img` (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`filename` TEXT,
|
|
|
|
`tovar_id` INTEGER,
|
|
|
|
`md5` TEXT,
|
2023-01-07 18:55:55 +05:00
|
|
|
`title` TEXT,
|
|
|
|
`alt` TEXT,
|
2023-01-02 21:33:36 +05:00
|
|
|
FOREIGN KEY (`tovar_id`) REFERENCES `tovar` (`id`));");
|
|
|
|
|
2022-12-17 19:10:16 +05:00
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `tovar_price_history` (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`tovar_id` INTEGER,
|
|
|
|
`status` INTEGER,
|
|
|
|
`docs_id` INTEGER,
|
|
|
|
`t` TEXT,
|
|
|
|
FOREIGN KEY (`tovar_id`) REFERENCES `tovar`(`id`),
|
|
|
|
FOREIGN KEY (`docs_id`) REFERENCES `docs`(`id`)
|
|
|
|
);");
|
|
|
|
|
2022-12-24 21:12:23 +05:00
|
|
|
|
2023-01-02 21:33:36 +05:00
|
|
|
|
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `tovar_history` (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`session_id` TEXT,
|
|
|
|
`tovar_id` INTEGER,
|
|
|
|
`t` TEXT,
|
|
|
|
FOREIGN KEY (`tovar_id`) REFERENCES `tovar`(`id`)
|
|
|
|
);");
|
|
|
|
|
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `tovar_har_sp` ( `id` INTEGER PRIMARY KEY NOT NULL, `txt` TEXT );");
|
|
|
|
|
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `tovar_har` (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`tovar_har_sp_id` INTEGER,
|
|
|
|
`tovar_id` INTEGER,
|
|
|
|
`txt` TEXT,
|
|
|
|
FOREIGN KEY (`tovar_id`) REFERENCES `tovar` (`id`),
|
|
|
|
FOREIGN KEY (`tovar_har_sp_id`) REFERENCES `tovar_har_sp` (`id`) );");
|
|
|
|
|
2022-12-24 21:12:23 +05:00
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS 'cart' (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`tovar_id` INTEGER,
|
|
|
|
`user_id` TEXT,
|
|
|
|
`kolvo` INTEGER,
|
|
|
|
`t` INTEGER,
|
|
|
|
FOREIGN KEY (`tovar_id`) REFERENCES `tovar`(`id`))");
|
|
|
|
|
2023-01-02 21:33:36 +05:00
|
|
|
|
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS 'tovar_barcode' (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`barcode` INTEGER,
|
|
|
|
`tovar_id` TEXT,
|
|
|
|
FOREIGN KEY (`tovar_id`) REFERENCES `tovar`(`id`))");
|
|
|
|
|
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS 'tovar_brand' (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`brand` INTEGER,
|
|
|
|
`tovar_id` TEXT,
|
|
|
|
FOREIGN KEY (`tovar_id`) REFERENCES `tovar`(`id`))");
|
|
|
|
|
2022-12-17 19:10:16 +05:00
|
|
|
\DB::alterTable("ALTER TABLE `tovar_price_history` ADD `cena` INTEGER");
|
|
|
|
\DB::alterTable("ALTER TABLE `tovar_price_history` ADD `docs_id` INTEGER");
|
|
|
|
\DB::alterTable("ALTER TABLE `docs` ADD `status` INTEGER");
|
2022-12-24 21:12:23 +05:00
|
|
|
\DB::alterTable("ALTER TABLE `docs` ADD `comment` TEXT");
|
2023-01-02 21:33:36 +05:00
|
|
|
\DB::alterTable("ALTER TABLE `meta` ADD `keywords` TEXT");
|
|
|
|
\DB::alterTable("ALTER TABLE `meta` ADD `description` TEXT");
|
2023-01-07 18:55:55 +05:00
|
|
|
\DB::alterTable("ALTER TABLE `tovar_img` ADD `alt` TEXT");
|
|
|
|
\DB::alterTable("ALTER TABLE `tovar_img` ADD `title` TEXT");
|
|
|
|
\DB::alterTable("ALTER TABLE `tovar_category_img` ADD `alt` TEXT");
|
|
|
|
\DB::alterTable("ALTER TABLE `tovar_category_img` ADD `title` TEXT");
|
|
|
|
\DB::alterTable("ALTER TABLE `tovar_category` ADD `keywords` TEXT");
|
|
|
|
\DB::alterTable("ALTER TABLE `tovar_category` ADD `description` TEXT");
|
|
|
|
\DB::alterTable("ALTER TABLE `site_speed` ADD `user_id` TEXT");
|
2023-01-14 21:17:46 +05:00
|
|
|
\DB::alterTable("ALTER TABLE `pages` ADD `d` TEXT");
|
|
|
|
|
2023-01-02 21:33:36 +05:00
|
|
|
|
2023-02-12 15:08:07 +05:00
|
|
|
\DB::alterTable("ALTER TABLE `users` ADD `soc_vk` TEXT");
|
|
|
|
\DB::alterTable("ALTER TABLE `users` ADD `soc_ok` TEXT");
|
|
|
|
\DB::alterTable("ALTER TABLE `users` ADD `soc_fb` TEXT");
|
|
|
|
\DB::alterTable("ALTER TABLE `users` ADD `soc_ig` TEXT");
|
|
|
|
\DB::alterTable("ALTER TABLE `users` ADD `soc_dz` TEXT");
|
|
|
|
\DB::alterTable("ALTER TABLE `users` ADD `soc_tw` TEXT");
|
|
|
|
\DB::alterTable("ALTER TABLE `users` ADD `soc_ld` TEXT");
|
|
|
|
\DB::alterTable("ALTER TABLE `users` ADD `soc_tg` TEXT");
|
|
|
|
\DB::alterTable("ALTER TABLE `users` ADD `spasibo` TEXT");
|
|
|
|
\DB::alterTable("ALTER TABLE `pages` ADD `reyt` INTEGER");
|
2023-02-13 16:05:33 +05:00
|
|
|
\DB::alterTable("ALTER TABLE `pages` ADD `see` INTEGER");
|
2023-02-19 21:07:48 +05:00
|
|
|
\DB::alterTable("ALTER TABLE `pages` ADD `comment` INTEGER");
|
2023-02-12 15:08:07 +05:00
|
|
|
|
|
|
|
// \DB::alterTable("ALTER TABLE `tovar_brand` ADD `description` TEXT");
|
2023-01-02 21:33:36 +05:00
|
|
|
|
2023-02-12 15:08:07 +05:00
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS 'likes' (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`tip` INTEGER,
|
|
|
|
`user_id` TEXT,
|
|
|
|
`content_id` INTEGER)");
|
2023-02-13 16:05:33 +05:00
|
|
|
|
|
|
|
|
|
|
|
\DB::set("CREATE TABLE IF NOT EXISTS `pages_comments` (
|
|
|
|
`id` INTEGER PRIMARY KEY NOT NULL,
|
|
|
|
`page_id` INTEGER,
|
|
|
|
`user_id` INTEGER,
|
|
|
|
`reyt` INTEGER,
|
|
|
|
`txt` TEXT,
|
|
|
|
`t` TEXT,
|
|
|
|
`status` INTEGER,
|
|
|
|
FOREIGN KEY (`page_id`) REFERENCES `pages` (`id`),
|
|
|
|
FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
|
|
|
|
|
|
|
|
);");
|
|
|
|
|
|
|
|
\DB::alterTable("ALTER TABLE `pages_comments` ADD `reyt` INTEGER");
|
2022-12-17 18:15:09 +05:00
|
|
|
?>
|