-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SVCSE-1595 Setup import of tables from staging FxA databases (#4578)
- Loading branch information
Showing
113 changed files
with
1,909 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
14 changes: 14 additions & 0 deletions
14
sql/moz-fx-data-shared-prod/accounts_db_nonprod_external/dataset_metadata.yaml
This file contains 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,14 @@ | ||
--- | ||
friendly_name: Firefox Accounts Databases nonprod (stage) External | ||
description: |- | ||
Data extracted from the nonprod (stage) FxA backend services databases. | ||
See https://mozilla.github.io/ecosystem-platform/reference/database-structure#database-fxa for more information. | ||
Access to this dataset is restricted to accounts-confidential workgroup because some tables here contain sensitive data. | ||
dataset_base_acl: restricted | ||
user_facing: false | ||
labels: {} | ||
workgroup_access: | ||
- role: roles/bigquery.dataViewer | ||
members: | ||
- workgroup:accounts-confidential |
18 changes: 18 additions & 0 deletions
18
...z-fx-data-shared-prod/accounts_db_nonprod_external/fxa_account_customers_v1/metadata.yaml
This file contains 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,18 @@ | ||
--- | ||
friendly_name: accountCustomers table from nonprod (stage) fxa database | ||
description: > | ||
A mirror of the `accountCustomers` table from the nonprod (stage) `fxa` CloudSQL database, | ||
updated daily to match the current state of the table. | ||
See https://mozilla.github.io/ecosystem-platform/reference/database-structure#database-fxa | ||
owners: | ||
- akomar@mozilla.com | ||
labels: | ||
application: accounts_backend | ||
schedule: daily | ||
scheduling: | ||
dag_name: bqetl_accounts_backend_external | ||
# destination is the whole table, not a single partition, | ||
# so don't use date_partition_parameter | ||
date_partition_parameter: null | ||
referenced_tables: [] |
17 changes: 17 additions & 0 deletions
17
sql/moz-fx-data-shared-prod/accounts_db_nonprod_external/fxa_account_customers_v1/query.sql
This file contains 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,17 @@ | ||
SELECT | ||
TO_HEX(uid) AS uid, | ||
stripeCustomerId, | ||
SAFE.TIMESTAMP_MILLIS(SAFE_CAST(createdAt AS INT)) AS createdAt, | ||
SAFE.TIMESTAMP_MILLIS(SAFE_CAST(updatedAt AS INT)) AS updatedAt, | ||
FROM | ||
EXTERNAL_QUERY( | ||
"moz-fx-fxa-nonprod.us.fxa-rds-nonprod-stage-fxa", | ||
"""SELECT | ||
uid, | ||
stripeCustomerId, | ||
createdAt, | ||
updatedAt | ||
FROM | ||
fxa.accountCustomers | ||
""" | ||
) |
14 changes: 14 additions & 0 deletions
14
...moz-fx-data-shared-prod/accounts_db_nonprod_external/fxa_account_customers_v1/schema.yaml
This file contains 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,14 @@ | ||
fields: | ||
- name: uid | ||
type: STRING | ||
mode: NULLABLE | ||
description: Account ID in hexadecimal format. | ||
- name: stripeCustomerId | ||
type: STRING | ||
mode: NULLABLE | ||
- name: createdAt | ||
type: TIMESTAMP | ||
mode: NULLABLE | ||
- name: updatedAt | ||
type: TIMESTAMP | ||
mode: NULLABLE |
18 changes: 18 additions & 0 deletions
18
...x-data-shared-prod/accounts_db_nonprod_external/fxa_account_reset_tokens_v1/metadata.yaml
This file contains 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,18 @@ | ||
--- | ||
friendly_name: accountResetTokens table from nonprod (stage) fxa database | ||
description: > | ||
A mirror of the `accountResetTokens` table from the nonprod (stage) `fxa` CloudSQL database, | ||
excluding columns containing confidential data, updated daily to match the current state of the table. | ||
See https://mozilla.github.io/ecosystem-platform/reference/database-structure#database-fxa | ||
owners: | ||
- akomar@mozilla.com | ||
labels: | ||
application: accounts_backend | ||
schedule: daily | ||
scheduling: | ||
dag_name: bqetl_accounts_backend_external | ||
# destination is the whole table, not a single partition, | ||
# so don't use date_partition_parameter | ||
date_partition_parameter: null | ||
referenced_tables: [] |
13 changes: 13 additions & 0 deletions
13
...oz-fx-data-shared-prod/accounts_db_nonprod_external/fxa_account_reset_tokens_v1/query.sql
This file contains 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,13 @@ | ||
SELECT | ||
TO_HEX(uid) AS uid, | ||
SAFE.TIMESTAMP_MILLIS(SAFE_CAST(createdAt AS INT)) AS createdAt, | ||
FROM | ||
EXTERNAL_QUERY( | ||
"moz-fx-fxa-nonprod.us.fxa-rds-nonprod-stage-fxa", | ||
"""SELECT | ||
uid, | ||
createdAt | ||
FROM | ||
fxa.accountResetTokens | ||
""" | ||
) |
8 changes: 8 additions & 0 deletions
8
...-fx-data-shared-prod/accounts_db_nonprod_external/fxa_account_reset_tokens_v1/schema.yaml
This file contains 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,8 @@ | ||
fields: | ||
- name: uid | ||
type: STRING | ||
mode: NULLABLE | ||
description: Account ID in hexadecimal format. | ||
- name: createdAt | ||
type: TIMESTAMP | ||
mode: NULLABLE |
18 changes: 18 additions & 0 deletions
18
sql/moz-fx-data-shared-prod/accounts_db_nonprod_external/fxa_accounts_v1/metadata.yaml
This file contains 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,18 @@ | ||
--- | ||
friendly_name: accounts table from nonprod (stage) fxa database | ||
description: > | ||
A mirror of the `accounts` table from the nonprod (stage) `fxa` CloudSQL database, | ||
excluding columns containing confidential data, updated daily to match the current state of the table. | ||
See https://mozilla.github.io/ecosystem-platform/reference/database-structure#database-fxa | ||
owners: | ||
- akomar@mozilla.com | ||
labels: | ||
application: accounts_backend | ||
schedule: daily | ||
scheduling: | ||
dag_name: bqetl_accounts_backend_external | ||
# destination is the whole table, not a single partition, | ||
# so don't use date_partition_parameter | ||
date_partition_parameter: null | ||
referenced_tables: [] |
37 changes: 37 additions & 0 deletions
37
sql/moz-fx-data-shared-prod/accounts_db_nonprod_external/fxa_accounts_v1/query.sql
This file contains 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,37 @@ | ||
SELECT | ||
TO_HEX(uid) AS uid, | ||
normalizedEmail, | ||
email, | ||
SAFE_CAST(emailVerified AS BOOL) AS emailVerified, | ||
verifierVersion, | ||
SAFE.TIMESTAMP_MILLIS(SAFE_CAST(verifierSetAt AS INT)) AS verifierSetAt, | ||
SAFE.TIMESTAMP_MILLIS(SAFE_CAST(createdAt AS INT)) AS createdAt, | ||
locale, | ||
SAFE.TIMESTAMP_MILLIS(SAFE_CAST(lockedAt AS INT)) AS lockedAt, | ||
SAFE.TIMESTAMP_MILLIS(SAFE_CAST(profileChangedAt AS INT)) AS profileChangedAt, | ||
SAFE.TIMESTAMP_MILLIS(SAFE_CAST(keysChangedAt AS INT)) AS keysChangedAt, | ||
ecosystemAnonId, | ||
SAFE.TIMESTAMP_MILLIS(SAFE_CAST(disabledAt AS INT)) AS disabledAt, | ||
SAFE.TIMESTAMP_MILLIS(SAFE_CAST(metricsOptOutAt AS INT)) AS metricsOptOutAt, | ||
FROM | ||
EXTERNAL_QUERY( | ||
"moz-fx-fxa-nonprod.us.fxa-rds-nonprod-stage-fxa", | ||
"""SELECT | ||
uid, | ||
normalizedEmail, | ||
email, | ||
emailVerified, | ||
verifierVersion, | ||
verifierSetAt, | ||
createdAt, | ||
locale, | ||
lockedAt, | ||
profileChangedAt, | ||
keysChangedAt, | ||
ecosystemAnonId, | ||
disabledAt, | ||
metricsOptOutAt | ||
FROM | ||
fxa.accounts | ||
""" | ||
) |
44 changes: 44 additions & 0 deletions
44
sql/moz-fx-data-shared-prod/accounts_db_nonprod_external/fxa_accounts_v1/schema.yaml
This file contains 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,44 @@ | ||
fields: | ||
- name: uid | ||
type: STRING | ||
mode: NULLABLE | ||
description: Account ID in hexadecimal format. | ||
- name: normalizedEmail | ||
type: STRING | ||
mode: NULLABLE | ||
- name: email | ||
type: STRING | ||
mode: NULLABLE | ||
- name: emailVerified | ||
type: BOOLEAN | ||
mode: NULLABLE | ||
- name: verifierVersion | ||
type: INTEGER | ||
mode: NULLABLE | ||
- name: verifierSetAt | ||
type: TIMESTAMP | ||
mode: NULLABLE | ||
- name: createdAt | ||
type: TIMESTAMP | ||
mode: NULLABLE | ||
- name: locale | ||
type: STRING | ||
mode: NULLABLE | ||
- name: lockedAt | ||
type: TIMESTAMP | ||
mode: NULLABLE | ||
- name: profileChangedAt | ||
type: TIMESTAMP | ||
mode: NULLABLE | ||
- name: keysChangedAt | ||
type: TIMESTAMP | ||
mode: NULLABLE | ||
- name: ecosystemAnonId | ||
type: STRING | ||
mode: NULLABLE | ||
- name: disabledAt | ||
type: TIMESTAMP | ||
mode: NULLABLE | ||
- name: metricsOptOutAt | ||
type: TIMESTAMP | ||
mode: NULLABLE |
18 changes: 18 additions & 0 deletions
18
sql/moz-fx-data-shared-prod/accounts_db_nonprod_external/fxa_db_metadata_v1/metadata.yaml
This file contains 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,18 @@ | ||
--- | ||
friendly_name: dbMetadata table from nonprod (stage) fxa database | ||
description: > | ||
A mirror of the `dbMetadata` table from the nonprod (stage) `fxa` CloudSQL database, | ||
updated daily to match the current state of the table. | ||
See https://mozilla.github.io/ecosystem-platform/reference/database-structure#database-fxa | ||
owners: | ||
- akomar@mozilla.com | ||
labels: | ||
application: accounts_backend | ||
schedule: daily | ||
scheduling: | ||
dag_name: bqetl_accounts_backend_external | ||
# destination is the whole table, not a single partition, | ||
# so don't use date_partition_parameter | ||
date_partition_parameter: null | ||
referenced_tables: [] |
13 changes: 13 additions & 0 deletions
13
sql/moz-fx-data-shared-prod/accounts_db_nonprod_external/fxa_db_metadata_v1/query.sql
This file contains 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,13 @@ | ||
SELECT | ||
name, | ||
value, | ||
FROM | ||
EXTERNAL_QUERY( | ||
"moz-fx-fxa-nonprod.us.fxa-rds-nonprod-stage-fxa", | ||
"""SELECT | ||
name, | ||
value | ||
FROM | ||
fxa.dbMetadata | ||
""" | ||
) |
7 changes: 7 additions & 0 deletions
7
sql/moz-fx-data-shared-prod/accounts_db_nonprod_external/fxa_db_metadata_v1/schema.yaml
This file contains 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,7 @@ | ||
fields: | ||
- name: name | ||
type: STRING | ||
mode: NULLABLE | ||
- name: value | ||
type: STRING | ||
mode: NULLABLE |
18 changes: 18 additions & 0 deletions
18
...-shared-prod/accounts_db_nonprod_external/fxa_device_command_identifiers_v1/metadata.yaml
This file contains 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,18 @@ | ||
--- | ||
friendly_name: deviceCommandIdentifiers table from nonprod (stage) fxa database | ||
description: > | ||
A mirror of the `deviceCommandIdentifiers` table from the nonprod (stage) `fxa` CloudSQL database, | ||
updated daily to match the current state of the table. | ||
See https://mozilla.github.io/ecosystem-platform/reference/database-structure#database-fxa | ||
owners: | ||
- akomar@mozilla.com | ||
labels: | ||
application: accounts_backend | ||
schedule: daily | ||
scheduling: | ||
dag_name: bqetl_accounts_backend_external | ||
# destination is the whole table, not a single partition, | ||
# so don't use date_partition_parameter | ||
date_partition_parameter: null | ||
referenced_tables: [] |
13 changes: 13 additions & 0 deletions
13
...data-shared-prod/accounts_db_nonprod_external/fxa_device_command_identifiers_v1/query.sql
This file contains 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,13 @@ | ||
SELECT | ||
commandId, | ||
commandName, | ||
FROM | ||
EXTERNAL_QUERY( | ||
"moz-fx-fxa-nonprod.us.fxa-rds-nonprod-stage-fxa", | ||
"""SELECT | ||
commandId, | ||
commandName | ||
FROM | ||
fxa.deviceCommandIdentifiers | ||
""" | ||
) |
7 changes: 7 additions & 0 deletions
7
...ta-shared-prod/accounts_db_nonprod_external/fxa_device_command_identifiers_v1/schema.yaml
This file contains 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,7 @@ | ||
fields: | ||
- name: commandId | ||
type: INTEGER | ||
mode: NULLABLE | ||
- name: commandName | ||
type: STRING | ||
mode: NULLABLE |
18 changes: 18 additions & 0 deletions
18
...moz-fx-data-shared-prod/accounts_db_nonprod_external/fxa_device_commands_v1/metadata.yaml
This file contains 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,18 @@ | ||
--- | ||
friendly_name: deviceCommands table from nonprod (stage) fxa database | ||
description: > | ||
A mirror of the `deviceCommands` table from the nonprod (stage) `fxa` CloudSQL database, | ||
excluding columns containing confidential data, updated daily to match the current state of the table. | ||
See https://mozilla.github.io/ecosystem-platform/reference/database-structure#database-fxa | ||
owners: | ||
- akomar@mozilla.com | ||
labels: | ||
application: accounts_backend | ||
schedule: daily | ||
scheduling: | ||
dag_name: bqetl_accounts_backend_external | ||
# destination is the whole table, not a single partition, | ||
# so don't use date_partition_parameter | ||
date_partition_parameter: null | ||
referenced_tables: [] |
15 changes: 15 additions & 0 deletions
15
sql/moz-fx-data-shared-prod/accounts_db_nonprod_external/fxa_device_commands_v1/query.sql
This file contains 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,15 @@ | ||
SELECT | ||
TO_HEX(uid) AS uid, | ||
deviceId, | ||
commandId, | ||
FROM | ||
EXTERNAL_QUERY( | ||
"moz-fx-fxa-nonprod.us.fxa-rds-nonprod-stage-fxa", | ||
"""SELECT | ||
uid, | ||
deviceId, | ||
commandId | ||
FROM | ||
fxa.deviceCommands | ||
""" | ||
) |
11 changes: 11 additions & 0 deletions
11
sql/moz-fx-data-shared-prod/accounts_db_nonprod_external/fxa_device_commands_v1/schema.yaml
This file contains 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,11 @@ | ||
fields: | ||
- name: uid | ||
type: STRING | ||
mode: NULLABLE | ||
description: Account ID in hexadecimal format. | ||
- name: deviceId | ||
type: STRING | ||
mode: NULLABLE | ||
- name: commandId | ||
type: INTEGER | ||
mode: NULLABLE |
18 changes: 18 additions & 0 deletions
18
sql/moz-fx-data-shared-prod/accounts_db_nonprod_external/fxa_devices_v1/metadata.yaml
This file contains 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,18 @@ | ||
--- | ||
friendly_name: devices table from nonprod (stage) fxa database | ||
description: > | ||
A mirror of the `devices` table from the nonprod (stage) `fxa` CloudSQL database, | ||
excluding columns containing confidential data, updated daily to match the current state of the table. | ||
See https://mozilla.github.io/ecosystem-platform/reference/database-structure#database-fxa | ||
owners: | ||
- akomar@mozilla.com | ||
labels: | ||
application: accounts_backend | ||
schedule: daily | ||
scheduling: | ||
dag_name: bqetl_accounts_backend_external | ||
# destination is the whole table, not a single partition, | ||
# so don't use date_partition_parameter | ||
date_partition_parameter: null | ||
referenced_tables: [] |
25 changes: 25 additions & 0 deletions
25
sql/moz-fx-data-shared-prod/accounts_db_nonprod_external/fxa_devices_v1/query.sql
This file contains 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,25 @@ | ||
SELECT | ||
TO_HEX(uid) AS uid, | ||
id, | ||
name, | ||
nameUtf8, | ||
type, | ||
SAFE.TIMESTAMP_MILLIS(SAFE_CAST(createdAt AS INT)) AS createdAt, | ||
callbackPublicKey, | ||
SAFE_CAST(callbackIsExpired AS BOOL) AS callbackIsExpired, | ||
FROM | ||
EXTERNAL_QUERY( | ||
"moz-fx-fxa-nonprod.us.fxa-rds-nonprod-stage-fxa", | ||
"""SELECT | ||
uid, | ||
id, | ||
name, | ||
nameUtf8, | ||
type, | ||
createdAt, | ||
callbackPublicKey, | ||
callbackIsExpired | ||
FROM | ||
fxa.devices | ||
""" | ||
) |
Oops, something went wrong.