лаба на 3
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
revision = "a6b12026a002"
|
||||
down_revision = "e5a12026a001"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.add_column(
|
||||
"attachment_jobs",
|
||||
sa.Column("next_attempt_at", sa.DateTime(timezone=True)),
|
||||
)
|
||||
|
||||
op.add_column(
|
||||
"attachment_jobs",
|
||||
sa.Column("last_error_code", sa.String(64)),
|
||||
)
|
||||
|
||||
op.add_column(
|
||||
"attachment_jobs",
|
||||
sa.Column("finished_at", sa.DateTime(timezone=True)),
|
||||
)
|
||||
|
||||
op.create_index(
|
||||
"ix_attachment_jobs_retry_schedule",
|
||||
"attachment_jobs",
|
||||
["status", "next_attempt_at"],
|
||||
)
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_index(
|
||||
"ix_attachment_jobs_retry_schedule",
|
||||
table_name="attachment_jobs",
|
||||
)
|
||||
|
||||
op.drop_column("attachment_jobs", "finished_at")
|
||||
op.drop_column("attachment_jobs", "last_error_code")
|
||||
op.drop_column("attachment_jobs", "next_attempt_at")
|
||||
Reference in New Issue
Block a user