feat: Database forward compatibility: make owner field optional#812
Merged
sokoliva merged 7 commits intoa2aproject:1.0-devfrom Mar 12, 2026
Merged
feat: Database forward compatibility: make owner field optional#812sokoliva merged 7 commits intoa2aproject:1.0-devfrom
owner field optional#812sokoliva merged 7 commits intoa2aproject:1.0-devfrom
Conversation
… into owner-optional
guglielmo-san
approved these changes
Mar 11, 2026
guglielmo-san
approved these changes
Mar 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Old version is not able to write in databases which are
1.0compatible because the newownerfield is mandatory. This change makes theownerfieldoptionalto maintain forward compatibility.Tested
Before change (owner field mandatory)
I created a database with tables
tasksandpush_notification_configsusing1.0spec. I then tested it against0.3spec by trying to write in it. It failed returning an error:NOT NULL constraint failed: tasks.owner.Also, I created a database with
0.3specTaskandPushNotificationConfigsentries but then made it1.0compatible via migration CLI commanduv run a2a-db. Reading such data using0.3spec worked, but writing failed for the same reason as before.After change (owner field optional)
I repeated the testing from before. Now writing in
1.0compatible databases worked.Notes
Writing in database which was created using
1.0spec without running the migrationa2a-dbCLI command, created entries which haveowner=NULLvalues, contrary to databases that underwent the migration usinga2a-dbwhich haveownerfield populated with the default value. In my case withlegacy_v03_no_user_infosince I didn't use the--add_columns_owner_last_updated-default-ownerflag to pass my own custom default value.Contributing Guide
CONTRIBUTINGGuide.fix:which represents bug fixes, and correlates to a SemVer patch.feat:represents a new feature, and correlates to a SemVer minor.feat!:, orfix!:,refactor!:, etc., which represent a breaking change (indicated by the!) and will result in a SemVer major.bash scripts/format.shfrom the repository root to format)Fixes #811 🦕