"""drop user_profiles Revision ID: 0123 Revises: 0122 Create Date: 2026-10-22 The Profile settings page asked for a display name, job title, expertise, response style, tone, interests and a work schedule, and said an assistant used them to personalise chat and a daily journal. Nothing in the app read any of it: the page saved to this table and the backup carried it, and that was all. The page, its API and the backup section are gone, and the table goes with them. Downgrade recreates the empty table, so the schema steps back cleanly; the rows themselves do not come back. """ import sqlalchemy as sa from alembic import op from sqlalchemy.dialects.postgresql import ARRAY, JSONB revision = "0123" down_revision = "0122" branch_labels = None depends_on = None def upgrade() -> None: op.drop_index("ix_user_profiles_user_id", table_name="user_profiles") op.drop_table("user_profiles") def downgrade() -> None: op.create_table( "user_profiles", sa.Column("id", sa.Integer(), primary_key=True), sa.Column( "user_id", sa.Integer(), sa.ForeignKey("users.id", ondelete="CASCADE"), nullable=False, unique=True, ), sa.Column("display_name", sa.Text(), nullable=True), sa.Column("job_title", sa.Text(), nullable=True), sa.Column("industry", sa.Text(), nullable=True), sa.Column("expertise_level", sa.Text(), nullable=True), sa.Column("response_style", sa.Text(), nullable=True), sa.Column("tone", sa.Text(), nullable=True), sa.Column("interests", ARRAY(sa.Text()), nullable=True), sa.Column("work_schedule", JSONB(), nullable=True), sa.Column( "created_at", sa.DateTime(timezone=True), server_default=sa.func.now(), nullable=False, ), sa.Column( "updated_at", sa.DateTime(timezone=True), server_default=sa.func.now(), nullable=False, ), ) op.create_index("ix_user_profiles_user_id", "user_profiles", ["user_id"], unique=True)