Skip to content

Commit 53c42aa

Browse files
authored
Add Migration From TS (#538)
1 parent a92c38d commit 53c42aa

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

dbos/_migration.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ def get_dbos_migration_six(schema: str) -> str:
243243
"""
244244

245245

246+
def get_dbos_migration_seven(schema: str) -> str:
247+
return f"""ALTER TABLE "{schema}"."workflow_status" ADD COLUMN "owner_xid" TEXT DEFAULT NULL;"""
248+
249+
246250
def get_dbos_migrations(schema: str) -> list[str]:
247251
return [
248252
get_dbos_migration_one(schema),
@@ -251,6 +255,7 @@ def get_dbos_migrations(schema: str) -> list[str]:
251255
get_dbos_migration_four(schema),
252256
get_dbos_migration_five(schema),
253257
get_dbos_migration_six(schema),
258+
get_dbos_migration_seven(schema),
254259
]
255260

256261

@@ -372,6 +377,10 @@ def get_sqlite_timestamp_expr() -> str:
372377
ALTER TABLE streams ADD COLUMN function_id INTEGER NOT NULL DEFAULT 0;
373378
"""
374379

380+
sqlite_migration_seven = (
381+
"""ALTER TABLE workflow_status ADD COLUMN "owner_xid" TEXT DEFAULT NULL;"""
382+
)
383+
375384

376385
sqlite_migrations = [
377386
sqlite_migration_one,

dbos/_schemas/system_database.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def set_schema(cls, schema_name: Optional[str]) -> None:
8080
Column("priority", Integer(), nullable=False, server_default=text("'0'::int")),
8181
Column("queue_partition_key", Text()),
8282
Column("forked_from", Text()),
83+
Column("owner_xid", Text()),
8384
Index("workflow_status_created_at_index", "created_at"),
8485
Index("workflow_status_executor_id_index", "executor_id"),
8586
Index("workflow_status_status_index", "status"),

0 commit comments

Comments
 (0)