"""Extend location model with new fields Revision ID: 020 Revises: 019 Create Date: 2026-02-24 """ from alembic import op import sqlalchemy as sa revision = '020' down_revision = '019' branch_labels = None depends_on = None def upgrade() -> None: op.add_column('locations', sa.Column('is_frequent', sa.Boolean(), nullable=False, server_default='false')) op.add_column('locations', sa.Column('contact_number', sa.String(50), nullable=True)) op.add_column('locations', sa.Column('email', sa.String(255), nullable=True)) # Belt-and-suspenders: ensure no NULL on is_frequent despite server_default op.execute("UPDATE locations SET is_frequent = FALSE WHERE is_frequent IS NULL") def downgrade() -> None: op.drop_column('locations', 'email') op.drop_column('locations', 'contact_number') op.drop_column('locations', 'is_frequent')