Phase 3.1: Enhanced Chore Logging and Reporting System
This commit is contained in:
commit
e3cae7bfbb
178 files changed
+30105
No files matched your search
@@ -0,0 +1,37 @@
|
||||
"""Add discord_id and profile_picture to users table."""
|
||||
import sqlite3
|
||||
from pathlib import Path
|
||||
|
||||
def migrate():
|
||||
"""Add new columns to users table."""
|
||||
db_path = Path("/app/data/familyhub.db")
|
||||
|
||||
conn = sqlite3.connect(db_path)
|
||||
cursor = conn.cursor()
|
||||
|
||||
try:
|
||||
# Add discord_id column
|
||||
cursor.execute("ALTER TABLE users ADD COLUMN discord_id VARCHAR(100)")
|
||||
print("✓ Added discord_id column")
|
||||
except sqlite3.OperationalError as e:
|
||||
if "duplicate column name" in str(e):
|
||||
print("✓ discord_id column already exists")
|
||||
else:
|
||||
raise
|
||||
|
||||
try:
|
||||
# Add profile_picture column
|
||||
cursor.execute("ALTER TABLE users ADD COLUMN profile_picture VARCHAR(500)")
|
||||
print("✓ Added profile_picture column")
|
||||
except sqlite3.OperationalError as e:
|
||||
if "duplicate column name" in str(e):
|
||||
print("✓ profile_picture column already exists")
|
||||
else:
|
||||
raise
|
||||
|
||||
conn.commit()
|
||||
conn.close()
|
||||
print("✓ Migration complete!")
|
||||
|
||||
if __name__ == "__main__":
|
||||
migrate()
|
||||
Reference in new issue
Block a user