generated from dopt-python/py311
change database structure for initial recording of individual persons
This commit is contained in:
19
prototypes/db_alter.py
Normal file
19
prototypes/db_alter.py
Normal 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)
|
||||
# %%
|
||||
Reference in New Issue
Block a user