change database structure for initial recording of individual persons

This commit is contained in:
2026-06-17 09:45:26 +02:00
parent 44402af0b7
commit 4a1d5d4647
3 changed files with 28 additions and 8 deletions

19
prototypes/db_alter.py Normal file
View File

@@ -0,0 +1,19 @@
# %%
import sqlalchemy as sql
from wce_crm import db
# %%
stmt = sql.text(
"ALTER TABLE grunderfassung_unternehmen ADD COLUMN Metadaten_wiedereintrittsdatum DATE"
)
with db.ENGINE.begin() as conn:
conn.execute(stmt)
# %%
stmt = sql.text("ALTER TABLE grunderfassung_unternehmen RENAME TO grunderfassung")
with db.ENGINE.begin() as conn:
conn.execute(stmt)
# %%