forked from mtusi2026/mtusi2026lab5
35 lines
833 B
Python
35 lines
833 B
Python
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") |