feat: advanced RW sync system
This commit is contained in:
46
alembic/versions/426b372286c3_add_rw_sync_outbox.py
Normal file
46
alembic/versions/426b372286c3_add_rw_sync_outbox.py
Normal file
@@ -0,0 +1,46 @@
|
||||
"""add rw sync outbox
|
||||
|
||||
Revision ID: 426b372286c3
|
||||
Revises: af1c3d7e4b20
|
||||
Create Date: 2026-08-20 21:31:20.949847
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '426b372286c3'
|
||||
down_revision: Union[str, Sequence[str], None] = 'af1c3d7e4b20'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
"""Upgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('rw_sync_outbox',
|
||||
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
|
||||
sa.Column('subscription_id', sa.INTEGER(), nullable=False),
|
||||
sa.Column('revision', sa.INTEGER(), nullable=False),
|
||||
sa.Column('attempts', sa.INTEGER(), nullable=False),
|
||||
sa.Column('next_attempt_at', sa.DateTime(timezone=True), nullable=False),
|
||||
sa.Column('locked_until', sa.DateTime(timezone=True), nullable=True),
|
||||
sa.Column('created_at', sa.DateTime(timezone=True), nullable=False),
|
||||
sa.Column('updated_at', sa.DateTime(timezone=True), nullable=False),
|
||||
sa.ForeignKeyConstraint(['subscription_id'], ['subscriptions.id'], ),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('subscription_id')
|
||||
)
|
||||
op.create_unique_constraint(None, 'service_notifications', ['id'])
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_constraint(None, 'service_notifications', type_='unique')
|
||||
op.drop_table('rw_sync_outbox')
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user