core/api/modules/quick-work/install_sqlite3.php

21 lines
611 B
PHP
Raw Normal View History

2023-05-03 14:51:58 +05:00
<?php
\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,
`region` TEXT,
`strana_id` TEXT,
FOREIGN KEY (`strana_id`) REFERENCES `strana` (`id`));");
\DB::set("CREATE TABLE IF NOT EXISTS `city` (
`id` INTEGER PRIMARY KEY NOT NULL,
`city` TEXT,
`region_id` INTEGER,
`strana_id` TEXT,
FOREIGN KEY (`strana_id`) REFERENCES `strana` (`id`),
FOREIGN KEY (`region_id`) REFERENCES `region` (`id`));");
?>