Skip to content

Commit 7553706

Browse files
committed
added mark for cancellation in DB
1 parent 7b83e63 commit 7553706

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
"""added_cancellation_mark
2+
3+
Revision ID: 10097b74cf5a
4+
Revises: fce5d231e16d
5+
Create Date: 2024-11-01 17:24:21.002659+00:00
6+
7+
"""
8+
import sqlalchemy as sa
9+
from alembic import op
10+
11+
# revision identifiers, used by Alembic.
12+
revision = "10097b74cf5a"
13+
down_revision = "fce5d231e16d"
14+
branch_labels = None
15+
depends_on = None
16+
17+
18+
def upgrade():
19+
# ### commands auto generated by Alembic - please adjust! ###
20+
op.add_column(
21+
"comp_runs",
22+
sa.Column(
23+
"marked_for_cancellation",
24+
sa.Boolean(),
25+
server_default=sa.text("false"),
26+
nullable=False,
27+
),
28+
)
29+
# ### end Alembic commands ###
30+
31+
32+
def downgrade():
33+
# ### commands auto generated by Alembic - please adjust! ###
34+
op.drop_column("comp_runs", "marked_for_cancellation")
35+
# ### end Alembic commands ###

packages/postgres-database/src/simcore_postgres_database/models/comp_runs.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
""" Computational Runs Table
22
33
"""
4+
45
import sqlalchemy as sa
56
from sqlalchemy.dialects.postgresql import JSONB
67
from sqlalchemy.sql import func
@@ -106,5 +107,12 @@
106107
nullable=False,
107108
doc="the run uses on demand clusters",
108109
),
110+
sa.Column(
111+
"marked_for_cancellation",
112+
sa.Boolean(),
113+
server_default=sa.sql.expression.false(),
114+
nullable=False,
115+
doc="the run was marked for cancellation",
116+
),
109117
sa.UniqueConstraint("project_uuid", "user_id", "iteration"),
110118
)

0 commit comments

Comments
 (0)