diff options
author | SveterCZE <petr.smerkl@live.com> | 2021-02-07 19:51:08 +0100 |
---|---|---|
committer | SveterCZE <petr.smerkl@live.com> | 2021-02-07 19:51:08 +0100 |
commit | d438d441c6b8c689ea98a117d284f014dbfb5b0e (patch) | |
tree | b756e7435c8c9cd0a5ff35919a21fb219281c549 | |
parent | 921cd69c9f23f7f4faa7eb24e63562058b54cb3f (diff) | |
parent | 32261d552c132b17ef4773422e4d6a778aaf9648 (diff) | |
download | justice-d438d441c6b8c689ea98a117d284f014dbfb5b0e.tar.gz |
Merge branch 'main' of https://github.com/SveterCZE/justice into main
-rw-r--r-- | db_creation | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/db_creation b/db_creation new file mode 100644 index 0000000..f2976b4 --- /dev/null +++ b/db_creation @@ -0,0 +1,66 @@ +CREATE TABLE "companies" ( + "id" INTEGER, + "ico" TEXT NOT NULL UNIQUE, + "nazev" TEXT, + "zapis" DATE, + "sidlo" TEXT, + "oddil" TEXT, + "vlozka" TEXT, + "soud" TEXT, + PRIMARY KEY("id" AUTOINCREMENT) +) + +CREATE TABLE "insolvency_events" ( + "id" INTEGER NOT NULL UNIQUE, + "company_id" TEXT NOT NULL, + "insolvency_event" TEXT UNIQUE, + FOREIGN KEY("company_id") REFERENCES "companies"("id"), + PRIMARY KEY("id" AUTOINCREMENT) +) + +CREATE TABLE "obce" ( + "id" INTEGER NOT NULL, + "obec_jmeno" TEXT NOT NULL UNIQUE, + PRIMARY KEY("id" AUTOINCREMENT) +) + +CREATE TABLE "obce_relation" ( + "company_id" INTEGER NOT NULL UNIQUE, + "obec_id" INTEGER NOT NULL, + FOREIGN KEY("obec_id") REFERENCES "obce"("id"), + FOREIGN KEY("company_id") REFERENCES "companies"("id") +) + +CREATE TABLE "osoby" ( + "id" INTEGER NOT NULL, + "osoba_jmeno" TEXT UNIQUE, + PRIMARY KEY("id" AUTOINCREMENT) +) + +CREATE TABLE "pravni_formy" ( + "id" INTEGER NOT NULL, + "pravni_forma" TEXT NOT NULL UNIQUE, + PRIMARY KEY("id" AUTOINCREMENT) +) + +CREATE TABLE "pravni_formy_relation" ( + "company_id" INTEGER NOT NULL UNIQUE, + "pravni_forma_id" INTEGER NOT NULL, + FOREIGN KEY("pravni_forma_id") REFERENCES "pravni_formy"("id"), + FOREIGN KEY("company_id") REFERENCES "companies"("id") +) + +CREATE TABLE sqlite_sequence(name,seq) + +CREATE TABLE "ulice" ( + "id" INTEGER NOT NULL, + "ulice_jmeno" TEXT NOT NULL UNIQUE, + PRIMARY KEY("id" AUTOINCREMENT) +) + +CREATE TABLE "ulice_relation" ( + "company_id" INTEGER NOT NULL UNIQUE, + "ulice_id" INTEGER NOT NULL, + FOREIGN KEY("company_id") REFERENCES "companies"("id"), + FOREIGN KEY("ulice_id") REFERENCES "ulice"("id") +) |