Skip to content

Commit

Permalink
added mark for cancellation in DB
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderegg committed Nov 8, 2024
1 parent 7b83e63 commit 7553706
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""added_cancellation_mark
Revision ID: 10097b74cf5a
Revises: fce5d231e16d
Create Date: 2024-11-01 17:24:21.002659+00:00
"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "10097b74cf5a"
down_revision = "fce5d231e16d"
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"comp_runs",
sa.Column(
"marked_for_cancellation",
sa.Boolean(),
server_default=sa.text("false"),
nullable=False,
),
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("comp_runs", "marked_for_cancellation")
# ### end Alembic commands ###
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
""" Computational Runs Table
"""

import sqlalchemy as sa
from sqlalchemy.dialects.postgresql import JSONB
from sqlalchemy.sql import func
Expand Down Expand Up @@ -106,5 +107,12 @@
nullable=False,
doc="the run uses on demand clusters",
),
sa.Column(
"marked_for_cancellation",
sa.Boolean(),
server_default=sa.sql.expression.false(),
nullable=False,
doc="the run was marked for cancellation",
),
sa.UniqueConstraint("project_uuid", "user_id", "iteration"),
)

0 comments on commit 7553706

Please sign in to comment.