"""phone_calls: the caller ID call log (plan step 3.5) Revision ID: 0023_phone_calls Revises: 0022_customer_display_key Create Date: 2026-11-17 12:00:00 """ from alembic import op import sqlalchemy as sa from core.timeutil import UTCDateTime revision = '0023_phone_calls' down_revision = '0022_customer_display_key' branch_labels = None depends_on = None def upgrade() -> None: op.create_table('phone_calls', sa.Column('id', sa.Integer(), nullable=False), sa.Column('at', UTCDateTime(), nullable=False), sa.Column('number', sa.String(), nullable=False), sa.Column('ext', sa.String(), nullable=True), sa.Column('customer_id', sa.Integer(), nullable=True), sa.ForeignKeyConstraint(['customer_id'], ['customers.id'], ondelete='SET NULL'), sa.PrimaryKeyConstraint('id'), ) with op.batch_alter_table('phone_calls', schema=None) as batch_op: batch_op.create_index(batch_op.f('ix_phone_calls_id'), ['id'], unique=False) batch_op.create_index(batch_op.f('ix_phone_calls_at'), ['at'], unique=False) def downgrade() -> None: op.drop_table('phone_calls')