Strassenverwaltung plus: Teilen von Strassenzügen
This commit is contained in:
1 parent
d54a986c14
commit
3eb3b746ab
22 files changed
+17391
-158
No files matched your search
@@ -109,6 +109,24 @@ def ensure_api_schema(db):
|
||||
db.commit()
|
||||
|
||||
|
||||
def ensure_street_schema(db):
|
||||
"""Ergänzt bestehende Datenbanken um das Straßenfeld ``zusatz``."""
|
||||
streets_table = db.execute(
|
||||
"SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'streets'"
|
||||
).fetchone()
|
||||
if not streets_table:
|
||||
return
|
||||
|
||||
columns = {
|
||||
row['name'] for row in db.execute('PRAGMA table_info(streets)').fetchall()
|
||||
}
|
||||
if 'zusatz' not in columns:
|
||||
db.execute(
|
||||
"ALTER TABLE streets ADD COLUMN zusatz TEXT NOT NULL DEFAULT ''"
|
||||
)
|
||||
db.commit()
|
||||
|
||||
|
||||
def ensure_schema():
|
||||
"""Ergänzt bestehende Datenbanken um das Gruppen-Account-Zuordnungsmodell.
|
||||
|
||||
@@ -120,6 +138,7 @@ def ensure_schema():
|
||||
db = get_db()
|
||||
ensure_ws_schema(db)
|
||||
ensure_api_schema(db)
|
||||
ensure_street_schema(db)
|
||||
groups_table = db.execute(
|
||||
"SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'groups'"
|
||||
).fetchone()
|
||||
|
||||
Reference in new issue
Block a user