Bug 2049279 - Add passport record type to autofill#7440
Open
DimiDL wants to merge 1 commit into
Open
Conversation
Add a passport autofill record type (name, country, passport number, and issue/expiry dates) with full CRUD, modeled on the existing addresses type. The schema is laid out sync-ready: passports_data carries a sync_change_counter alongside passports_mirror / passports_tombstones and the sync staging tables, so a sync engine can be added later without a schema migration. No sync engine is registered yet, so passports are not synced. Fields follow the autofill convention - stored as plaintext, with empty/0 meaning "not provided".
mhammond
reviewed
Jun 23, 2026
mhammond
left a comment
Member
There was a problem hiding this comment.
This looks like I expected it to :)
| } | ||
|
|
||
| fn upgrade_from_v4(db: &Connection) -> Result<()> { | ||
| let migration_string: &str = include_str!("../../sql/migrations/v5_migration.sql"); |
Member
There was a problem hiding this comment.
Do we need this migration, or can we just re-execute create_shared_schema? That would avoid needing the test for them drifting too. I'm not sure why the others weren't done that way, but that's the approach most other components use
| CREATE TABLE IF NOT EXISTS passports_tombstones ( | ||
| guid TEXT PRIMARY KEY CHECK(length(guid) != 0), | ||
| time_deleted INTEGER NOT NULL | ||
| ) WITHOUT ROWID; |
Member
There was a problem hiding this comment.
you don't have the shared triggers for this yet. That seems fine I guess until you sync though.
| sync_change_counter INTEGER NOT NULL | ||
| ); | ||
|
|
||
| DROP TABLE IF EXISTS passports_sync_staging; |
Member
There was a problem hiding this comment.
because these are temp tables you don't actually need them yet - they can be added later without needing a migration. I guess there's no harm adding them though, but also no real benefit.
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.
Add a passport autofill record type (name, country, passport number, and issue/expiry dates) with full CRUD, modeled on the existing addresses type.
The schema is laid out sync-ready: passports_data carries a sync_change_counter alongside passports_mirror / passports_tombstones and the sync staging tables, so a sync engine can be added later without a schema migration. No sync engine is registered yet, so passports are not synced. Fields follow the autofill convention - stored as plaintext, with empty/0 meaning "not provided".
Pull Request checklist
[ci full]to the PR title.