33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
"""add attempts and scheduled_at
|
|
|
|
Revision ID: dc2ac7a34e72
|
|
Revises: 164e1973508a
|
|
Create Date: 2026-11-27 13:21:19.796557
|
|
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = 'dc2ac7a34e72'
|
|
down_revision: Union[str, None] = '164e1973508a'
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.add_column('attachments', sa.Column('attempts', sa.Integer(), nullable=False, server_default='0'))
|
|
op.add_column('outbox', sa.Column('scheduled_at', sa.DateTime(timezone=True), nullable=False, server_default=sa.text('now()')))
|
|
op.create_index(op.f('ix_outbox_scheduled_at'), 'outbox', ['scheduled_at'], unique=False)
|
|
|
|
|
|
def downgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_index(op.f('ix_outbox_scheduled_at'), table_name='outbox')
|
|
op.drop_column('outbox', 'scheduled_at')
|
|
op.drop_column('attachments', 'attempts')
|
|
# ### end Alembic commands ###
|