Fix DB model.

This commit is contained in:
2025-07-09 18:08:14 +02:00
parent b488676327
commit 092a8b7084
3 changed files with 8 additions and 5 deletions

View File

@@ -0,0 +1,7 @@
-- Remove all email preference columns from user_preferences table
-- These columns were not being used and are being removed to clean up the schema
ALTER TABLE user_preferences
DROP COLUMN IF EXISTS email_daily_summary,
DROP COLUMN IF EXISTS email_notifications,
DROP COLUMN IF EXISTS email_weekly_summary;

View File

@@ -18,6 +18,7 @@ MIGRATION_STATE_FILE = '/data/postgres_migrations_state.json'
POSTGRES_MIGRATIONS = [
'postgres_only_migration.py', # Main migration from commit 4214e88 onward
'add_note_sharing.sql', # Add note sharing functionality
'remove_email_preferences.sql', # Remove unused email preference columns
]

View File

@@ -156,11 +156,6 @@ class UserPreferences(db.Model):
date_format = db.Column(db.String(20), default='YYYY-MM-DD')
time_format = db.Column(db.String(10), default='24h')
# Notification preferences
email_notifications = db.Column(db.Boolean, default=True)
email_daily_summary = db.Column(db.Boolean, default=False)
email_weekly_summary = db.Column(db.Boolean, default=True)
# Time tracking preferences
default_project_id = db.Column(db.Integer, db.ForeignKey('project.id'), nullable=True)
timer_reminder_enabled = db.Column(db.Boolean, default=True)