feat: aggiunti: loggica random, tema scuro, correzioni mail, miglioramenti generali, cache;
This commit is contained in:
25
migrate_db.py
Normal file
25
migrate_db.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import sqlite3
|
||||
|
||||
def migrate():
|
||||
db_path = "data/parking.db"
|
||||
try:
|
||||
conn = sqlite3.connect(db_path)
|
||||
cursor = conn.cursor()
|
||||
|
||||
# Add the new column
|
||||
cursor.execute("ALTER TABLE offices ADD COLUMN assignment_mode VARCHAR DEFAULT 'fairness'")
|
||||
|
||||
print("Success: Added assignment_mode to offices table.")
|
||||
|
||||
conn.commit()
|
||||
except sqlite3.OperationalError as e:
|
||||
if "duplicate column name" in str(e):
|
||||
print("Info: Column assignment_mode already exists.")
|
||||
else:
|
||||
print(f"Error: {e}")
|
||||
finally:
|
||||
if conn:
|
||||
conn.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
migrate()
|
||||
Reference in New Issue
Block a user