Skip to content

Commit be9b87c

Browse files
clouserwsean-rose
andauthored
Add recoveryPhones to accounts db. Fix SVCSE-2521 (#7104)
* Add recoveryPhones to accounts table. Fix SVCSE-2521 * Remove extra blank lines. --------- Co-authored-by: Sean Rose <[email protected]>
1 parent 02419dd commit be9b87c

File tree

6 files changed

+106
-0
lines changed

6 files changed

+106
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
friendly_name: recoveryPhones table from production fxa database
3+
description: >
4+
A mirror of the `recoveryPhones` table from the production `fxa` CloudSQL database,
5+
excluding columns containing confidential data, updated daily to match the current state of the table.
6+
7+
See https://mozilla.github.io/ecosystem-platform/reference/database-structure#database-fxa
8+
owners:
9+
10+
labels:
11+
application: accounts_backend
12+
schedule: daily
13+
scheduling:
14+
dag_name: bqetl_accounts_backend_external
15+
# destination is the whole table, not a single partition,
16+
# so don't use date_partition_parameter
17+
date_partition_parameter: null
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
SELECT
2+
TO_HEX(uid) AS uid,
3+
phoneNumber,
4+
SAFE.TIMESTAMP_MILLIS(SAFE_CAST(createdAt AS INT)) AS createdAt,
5+
SAFE.TIMESTAMP_MILLIS(SAFE_CAST(lastConfirmed AS INT)) AS lastConfirmed,
6+
SAFE.PARSE_JSON(lookupData) AS lookupData
7+
FROM
8+
EXTERNAL_QUERY(
9+
"moz-fx-fxa-prod.us.fxa-rds-prod-prod-fxa",
10+
"""SELECT
11+
uid,
12+
phoneNumber,
13+
createdAt,
14+
lastConfirmed,
15+
lookupData
16+
FROM
17+
fxa.recoveryPhones
18+
"""
19+
)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
fields:
2+
- name: uid
3+
type: INTEGER
4+
mode: NULLABLE
5+
description: Account ID in hexadecimal format.
6+
- name: phoneNumber
7+
type: STRING
8+
mode: NULLABLE
9+
- name: createdAt
10+
type: TIMESTAMP
11+
mode: NULLABLE
12+
- name: lastConfirmed
13+
type: TIMESTAMP
14+
mode: NULLABLE
15+
- name: lookupData
16+
type: JSON
17+
mode: NULLABLE
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
friendly_name: recoveryPhones table from nonprod (stage) fxa database
3+
description: >
4+
A mirror of the `recoveryPhones` table from the nonprod (stage) `fxa` CloudSQL database,
5+
excluding columns containing confidential data, updated daily to match the current state of the table.
6+
7+
See https://mozilla.github.io/ecosystem-platform/reference/database-structure#database-fxa
8+
owners:
9+
10+
labels:
11+
application: accounts_backend
12+
schedule: daily
13+
scheduling:
14+
dag_name: bqetl_accounts_backend_external
15+
# destination is the whole table, not a single partition,
16+
# so don't use date_partition_parameter
17+
date_partition_parameter: null
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
SELECT
2+
TO_HEX(uid) AS uid,
3+
phoneNumber,
4+
SAFE.TIMESTAMP_MILLIS(SAFE_CAST(createdAt AS INT)) AS createdAt,
5+
SAFE.TIMESTAMP_MILLIS(SAFE_CAST(lastConfirmed AS INT)) AS lastConfirmed,
6+
SAFE.PARSE_JSON(lookupData) AS lookupData
7+
FROM
8+
EXTERNAL_QUERY(
9+
"moz-fx-fxa-nonprod.us.fxa-rds-nonprod-stage-fxa",
10+
"""SELECT
11+
uid,
12+
phoneNumber,
13+
createdAt,
14+
lastConfirmed,
15+
lookupData
16+
FROM
17+
fxa.recoveryPhones
18+
"""
19+
)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
fields:
2+
- name: uid
3+
type: INTEGER
4+
mode: NULLABLE
5+
description: Account ID in hexadecimal format.
6+
- name: phoneNumber
7+
type: STRING
8+
mode: NULLABLE
9+
- name: createdAt
10+
type: TIMESTAMP
11+
mode: NULLABLE
12+
- name: lastConfirmed
13+
type: TIMESTAMP
14+
mode: NULLABLE
15+
- name: lookupData
16+
type: JSON
17+
mode: NULLABLE

0 commit comments

Comments
 (0)