forked from mtusi2026/mtusi2026lab5
feat: implement transactional outbox, dlq and worker timeouts
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
"""add outbox table
|
||||
|
||||
Revision ID: 164e1973508a
|
||||
Revises: d15635c49e1a
|
||||
Create Date: 2026-11-12 21:18:12.919668
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '164e1973508a'
|
||||
down_revision: Union[str, None] = 'd15635c49e1a'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('outbox',
|
||||
sa.Column('id', sa.UUID(), nullable=False),
|
||||
sa.Column('payload', sa.Text(), nullable=False),
|
||||
sa.Column('status', sa.String(length=20), nullable=False),
|
||||
sa.Column('created_at', sa.DateTime(timezone=True), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_index(op.f('ix_outbox_status'), 'outbox', ['status'], unique=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index(op.f('ix_outbox_status'), table_name='outbox')
|
||||
op.drop_table('outbox')
|
||||
# ### end Alembic commands ###
|
||||
@@ -20,7 +20,7 @@ depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('attachments', sa.Column('variants', postgresql.JSONB(astext_type=sa.Text()), nullable=False))
|
||||
op.add_column('attachments', sa.Column('variants', postgresql.JSONB(astext_type=sa.Text()), server_default='[]', nullable=False))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user