-
Notifications
You must be signed in to change notification settings - Fork 267
Bug 2049279 - Add passport record type to autofill #7440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
DimiDL
wants to merge
1
commit into
mozilla:main
Choose a base branch
from
DimiDL:passport-autofill
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,3 +27,16 @@ CREATE TEMP TABLE credit_cards_sync_outgoing_staging ( | |
| payload TEXT NOT NULL CHECK(length(payload) != 0), | ||
| sync_change_counter INTEGER NOT NULL | ||
| ); | ||
|
|
||
| DROP TABLE IF EXISTS passports_sync_staging; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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. |
||
| CREATE TEMP TABLE passports_sync_staging ( | ||
| guid TEXT NOT NULL PRIMARY KEY CHECK(length(guid) != 0), | ||
| payload TEXT NOT NULL CHECK(length(payload) != 0) | ||
| ); | ||
|
|
||
| DROP TABLE IF EXISTS passports_sync_outgoing_staging; | ||
| CREATE TEMP TABLE passports_sync_outgoing_staging ( | ||
| guid TEXT NOT NULL PRIMARY KEY CHECK(length(guid) != 0), | ||
| payload TEXT NOT NULL CHECK(length(payload) != 0), | ||
| sync_change_counter INTEGER NOT NULL | ||
| ); | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| -- This Source Code Form is subject to the terms of the Mozilla Public | ||
| -- License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| -- file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
|
||
| -- v4 -> v5: add the passports_data table and its sync mirror/tombstone tables. | ||
| CREATE TABLE IF NOT EXISTS passports_data ( | ||
| guid TEXT NOT NULL PRIMARY KEY CHECK(length(guid) != 0), | ||
| name TEXT NOT NULL, -- full name on passport | ||
| country TEXT NOT NULL, -- ISO 3166 code | ||
| passport_number TEXT NOT NULL, | ||
| issue_date_month INTEGER, | ||
| issue_date_day INTEGER, | ||
| issue_date_year INTEGER, | ||
| expiry_date_month INTEGER, | ||
| expiry_date_day INTEGER, | ||
| expiry_date_year INTEGER, | ||
|
|
||
| time_created INTEGER NOT NULL, | ||
| time_last_used INTEGER, | ||
| time_last_modified INTEGER NOT NULL, | ||
| times_used INTEGER NOT NULL, | ||
|
|
||
| /* Same "sync change counter" strategy used by other components. */ | ||
| sync_change_counter INTEGER NOT NULL | ||
| ); | ||
|
|
||
| CREATE TABLE IF NOT EXISTS passports_mirror ( | ||
| guid TEXT NOT NULL PRIMARY KEY CHECK(length(guid) != 0), | ||
| -- The plain-text sync15 payload. | ||
| payload TEXT NOT NULL CHECK(length(payload) != 0) | ||
| ); | ||
|
|
||
| CREATE TABLE IF NOT EXISTS passports_tombstones ( | ||
| guid TEXT PRIMARY KEY CHECK(length(guid) != 0), | ||
| time_deleted INTEGER NOT NULL | ||
| ) WITHOUT ROWID; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| -- This Source Code Form is subject to the terms of the Mozilla Public | ||
| -- License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| -- file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
|
||
| -- Initialize the v3 schema | ||
|
|
||
| CREATE TABLE IF NOT EXISTS addresses_data ( | ||
| guid TEXT NOT NULL PRIMARY KEY CHECK(length(guid) != 0), | ||
| name TEXT NOT NULL, | ||
| organization TEXT NOT NULL, -- Company | ||
| street_address TEXT NOT NULL, -- (Multiline) | ||
| address_level3 TEXT NOT NULL, -- Suburb/Sublocality | ||
| address_level2 TEXT NOT NULL, -- City/Town | ||
| address_level1 TEXT NOT NULL, -- Province (Standardized code if possible) | ||
| postal_code TEXT NOT NULL, | ||
| country TEXT NOT NULL, -- ISO 3166 | ||
| tel TEXT NOT NULL, -- Stored in E.164 format | ||
| email TEXT NOT NULL, | ||
|
|
||
| time_created INTEGER NOT NULL, | ||
| time_last_used INTEGER NOT NULL, | ||
| time_last_modified INTEGER NOT NULL, | ||
| times_used INTEGER NOT NULL, | ||
|
|
||
| sync_change_counter INTEGER NOT NULL | ||
| ); | ||
|
|
||
| -- What's on the server as the JSON payload. | ||
| CREATE TABLE IF NOT EXISTS addresses_mirror ( | ||
| guid TEXT NOT NULL PRIMARY KEY CHECK(length(guid) != 0), | ||
| payload TEXT NOT NULL CHECK(length(payload) != 0) | ||
| -- We could also have `modified`, which is in the server response and | ||
| -- passed around in the sync code, but we don't have a use-case for using it. | ||
| ); | ||
|
|
||
| -- Tombstones are items deleted locally but not deleted in the mirror (ie, ones | ||
| -- we are yet to upload) | ||
| CREATE TABLE IF NOT EXISTS addresses_tombstones ( | ||
| guid TEXT PRIMARY KEY CHECK(length(guid) != 0), | ||
| time_deleted INTEGER NOT NULL | ||
| ) WITHOUT ROWID; | ||
|
|
||
| CREATE TABLE IF NOT EXISTS credit_cards_data ( | ||
| guid TEXT NOT NULL PRIMARY KEY CHECK(length(guid) != 0), | ||
| cc_name TEXT NOT NULL, | ||
| cc_number_enc TEXT NOT NULL CHECK(length(cc_number_enc) > 20 OR cc_number_enc == ''), | ||
| cc_number_last_4 TEXT NOT NULL CHECK(length(cc_number_last_4) <= 4), | ||
| cc_exp_month INTEGER, | ||
| cc_exp_year INTEGER, | ||
| cc_type TEXT NOT NULL, | ||
| time_created INTEGER NOT NULL, | ||
| time_last_used INTEGER, | ||
| time_last_modified INTEGER NOT NULL, | ||
| times_used INTEGER NOT NULL, | ||
| sync_change_counter INTEGER NOT NULL | ||
| ); | ||
|
|
||
| CREATE TABLE IF NOT EXISTS credit_cards_mirror ( | ||
| guid TEXT NOT NULL PRIMARY KEY CHECK(length(guid) != 0), | ||
| payload TEXT NOT NULL CHECK(length(payload) != 0) | ||
| ); | ||
|
|
||
| CREATE TABLE IF NOT EXISTS credit_cards_tombstones ( | ||
| guid TEXT PRIMARY KEY CHECK(length(guid) != 0), | ||
| time_deleted INTEGER NOT NULL | ||
| ) WITHOUT ROWID; | ||
|
|
||
| -- This table holds key-value metadata for the Autofill component and its consumers. | ||
| CREATE TABLE IF NOT EXISTS moz_meta ( | ||
| key TEXT PRIMARY KEY, | ||
| value NOT NULL | ||
| ) WITHOUT ROWID; | ||
|
|
||
| -- Populate it with some data, we test that this makes it through all the migrations. | ||
| INSERT INTO credit_cards_data ( | ||
| guid, cc_name, cc_number_enc, cc_number_last_4, cc_exp_month, cc_exp_year, | ||
| cc_type, time_created, time_last_used, time_last_modified, times_used, | ||
| sync_change_counter | ||
| ) VALUES ( | ||
| "A", "Jane Doe", "012345678901234567890", "1234", 1, 2020, "visa", 0, 1, 2, | ||
| 3, 0 | ||
| ); | ||
|
|
||
| INSERT INTO addresses_data ( | ||
| guid, name, organization, street_address, address_level3, | ||
| address_level2, address_level1, postal_code, country, tel, | ||
| email, time_created, time_last_used, time_last_modified, | ||
| times_used, sync_change_counter | ||
| ) VALUES ( | ||
| "A", "Jane John Doe", "Mozilla", "123 Maple lane", "Shelbyville", | ||
| "Springfield", "Massachusetts", "12345", "US", "01-234-567-8000", "jane@hotmail.com", 0, | ||
| 1, 2, 3, 0 | ||
| ); | ||
|
|
||
| INSERT INTO addresses_data ( | ||
| guid, name, organization, street_address, address_level3, | ||
| address_level2, address_level1, postal_code, country, tel, | ||
| email, time_created, time_last_used, time_last_modified, | ||
| times_used, sync_change_counter | ||
| ) VALUES ( | ||
| "B", "", "Mozilla", "123 Maple lane", "Shelbyville", | ||
| "Toronto", "Ontario", "12345", "CA", "01-234-567-8000", "jane@hotmail.com", 0, | ||
| 1, 2, 3, 0 | ||
| ); | ||
| PRAGMA user_version=4; |
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't have the shared triggers for this yet. That seems fine I guess until you sync though.