Skip to content

Commit 955aaab

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

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/a2a/a2a_db_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def create_parser() -> argparse.ArgumentParser:
5858
parser.add_argument(
5959
'--add_columns_owner_last_updated-default-owner',
6060
dest='owner',
61-
help="Value for the 'owner' column (used in specific migrations). If not set defaults to 'unknown'",
61+
help="Value for the 'owner' column (used in specific migrations). If not set defaults to 'legacy_v03_no_user_info'",
6262
)
6363
_add_shared_args(parser)
6464

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)