Skip to content

Commit e24fa5d

Browse files
committed
feat: update owner column to be nullable in tasks and push notification config tables
1 parent bbd09f2 commit e24fa5d

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/a2a/migrations/versions/6419d2d130f6_add_columns_owner_last_updated.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def upgrade() -> None:
4747
)
4848

4949
if table_exists(tasks_table):
50-
add_column(tasks_table, 'owner', False, sa.String(255), owner)
50+
add_column(tasks_table, 'owner', True, sa.String(255), owner)
5151
add_column(tasks_table, 'last_updated', True, sa.DateTime())
5252
add_index(
5353
tasks_table,
@@ -63,7 +63,7 @@ def upgrade() -> None:
6363
add_column(
6464
push_notification_configs_table,
6565
'owner',
66-
False,
66+
True,
6767
sa.String(255),
6868
owner,
6969
)

src/a2a/server/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class TaskMixin:
4444
kind: Mapped[str] = mapped_column(
4545
String(16), nullable=False, default='task'
4646
)
47-
owner: Mapped[str] = mapped_column(String(255), nullable=False)
47+
owner: Mapped[str] = mapped_column(String(255), nullable=True)
4848
last_updated: Mapped[datetime | None] = mapped_column(
4949
DateTime, nullable=True
5050
)
@@ -145,7 +145,7 @@ class PushNotificationConfigMixin:
145145
task_id: Mapped[str] = mapped_column(String(36), primary_key=True)
146146
config_id: Mapped[str] = mapped_column(String(255), primary_key=True)
147147
config_data: Mapped[bytes] = mapped_column(LargeBinary, nullable=False)
148-
owner: Mapped[str] = mapped_column(String(255), nullable=False, index=True)
148+
owner: Mapped[str] = mapped_column(String(255), nullable=True, index=True)
149149
protocol_version: Mapped[str | None] = mapped_column(
150150
String(16), nullable=True
151151
)

0 commit comments

Comments
 (0)