Skip to content

Commit baee189

Browse files
committed
added column back
1 parent fee208d commit baee189

File tree

2 files changed

+37
-3
lines changed

2 files changed

+37
-3
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""add deprecated submit column
2+
3+
Revision ID: 307017ee1a49
4+
Revises: 1e3c9c804fec
5+
Create Date: 2025-01-06 12:53:51.604189+00:00
6+
7+
"""
8+
from alembic import op
9+
import sqlalchemy as sa
10+
11+
12+
# revision identifiers, used by Alembic.
13+
revision = '307017ee1a49'
14+
down_revision = '1e3c9c804fec'
15+
branch_labels = None
16+
depends_on = None
17+
18+
19+
def upgrade():
20+
# ### commands auto generated by Alembic - please adjust! ###
21+
op.add_column('comp_tasks', sa.Column('submit', sa.DateTime(timezone=True), server_default=sa.text("'1900-01-01T00:00:00Z'::timestamptz"), nullable=True))
22+
# ### end Alembic commands ###
23+
24+
25+
def downgrade():
26+
# ### commands auto generated by Alembic - please adjust! ###
27+
op.drop_column('comp_tasks', 'submit')
28+
# ### end Alembic commands ###

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
""" Computational Tasks Table
2-
3-
"""
1+
"""Computational Tasks Table"""
42

53
import enum
64

@@ -102,6 +100,14 @@ class NodeClass(enum.Enum):
102100
nullable=True,
103101
doc="Harware information of this task",
104102
),
103+
# deprecated columns must be kept due to legacy services
104+
# utc timestamps for submission/start/end
105+
sa.Column(
106+
"submit",
107+
sa.DateTime(timezone=True),
108+
server_default=sa.text("'1900-01-01T00:00:00Z'::timestamptz"),
109+
doc="[DEPRECATED unused but kept for legacy services and must be filled with a default value of 1 January 1900]",
110+
),
105111
# ------
106112
sa.UniqueConstraint("project_id", "node_id", name="project_node_uniqueness"),
107113
)

0 commit comments

Comments
 (0)