aboutsummaryrefslogtreecommitdiffstats
path: root/db_creation.py
diff options
context:
space:
mode:
Diffstat (limited to 'db_creation.py')
-rw-r--r--db_creation.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/db_creation.py b/db_creation.py
index c1f0cc1..a8fefe7 100644
--- a/db_creation.py
+++ b/db_creation.py
@@ -113,7 +113,9 @@ def create_tables(conn):
"prijmeni" TEXT,
"titul_za" TEXT,
"datum_naroz" TEXT,
- UNIQUE("titul_pred","jmeno","prijmeni","titul_za","datum_naroz"),
+ "adresa_id" INTEGER,
+ UNIQUE("titul_pred","jmeno","prijmeni","titul_za","datum_naroz","adresa_id"),
+ FOREIGN KEY("adresa_id") REFERENCES "adresy_v2"("id"),
PRIMARY KEY("id" AUTOINCREMENT)
); """
@@ -232,7 +234,9 @@ def create_tables(conn):
"ico" INTEGER,
"reg_cislo" INTEGER,
"nazev" TEXT,
- UNIQUE("ico","reg_cislo","nazev"),
+ "adresa_id" INTEGER,
+ UNIQUE("ico","reg_cislo","nazev","adresa_id"),
+ FOREIGN KEY("adresa_id") REFERENCES "adresy_v2"("id"),
PRIMARY KEY("id" AUTOINCREMENT)
); """