forked from mtusi2026/mtusi2026lab5
lab5: асинхронный воркер, брокер сообщений
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
revision = "12043b148948"
|
||||
down_revision = "ffdfa8869ddc"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.create_table(
|
||||
"outbox_events",
|
||||
sa.Column("id", sa.Uuid(), nullable=False),
|
||||
sa.Column("attachment_id", sa.Uuid(), nullable=False),
|
||||
sa.Column(
|
||||
"created_at",
|
||||
sa.DateTime(timezone=True),
|
||||
server_default=sa.text("now()"),
|
||||
nullable=False
|
||||
),
|
||||
sa.Column(
|
||||
"published_at",
|
||||
sa.DateTime(timezone=True),
|
||||
nullable=True
|
||||
),
|
||||
sa.ForeignKeyConstraint(
|
||||
["attachment_id"],
|
||||
["attachments.id"]
|
||||
),
|
||||
sa.PrimaryKeyConstraint("id")
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_table("outbox_events")
|
||||
Reference in New Issue
Block a user