mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
Add billingAccountId to BillingData table
Join RegistrarAccountId table to BillingData to append additional billingAccountId column ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=151362466
This commit is contained in:
parent
91c2558feb
commit
190be064cb
1 changed files with 14 additions and 0 deletions
|
@ -23,6 +23,7 @@ SELECT
|
||||||
BillingEvent.eventTime AS eventTime,
|
BillingEvent.eventTime AS eventTime,
|
||||||
BillingEvent.clientId AS registrarId,
|
BillingEvent.clientId AS registrarId,
|
||||||
Registrar.billingIdentifier AS billingId,
|
Registrar.billingIdentifier AS billingId,
|
||||||
|
RegistrarAccount.billingAccountId AS billingAccountId,
|
||||||
BillingEvent.tld AS tld,
|
BillingEvent.tld AS tld,
|
||||||
IF(
|
IF(
|
||||||
CONCAT(',', BillingEvent.flags, ',') CONTAINS (',ALLOCATION,'),
|
CONCAT(',', BillingEvent.flags, ',') CONTAINS (',ALLOCATION,'),
|
||||||
|
@ -88,6 +89,19 @@ LEFT JOIN EACH (
|
||||||
ON
|
ON
|
||||||
BillingEvent.clientId = Registrar.clientId
|
BillingEvent.clientId = Registrar.clientId
|
||||||
|
|
||||||
|
-- Join to pick up currency specific registrar account id from registrar
|
||||||
|
-- account view.
|
||||||
|
LEFT JOIN EACH (
|
||||||
|
SELECT
|
||||||
|
registrarId,
|
||||||
|
billingAccountId,
|
||||||
|
currency
|
||||||
|
FROM
|
||||||
|
[%DEST_DATASET%.RegistrarAccountData]) AS RegistrarAccount
|
||||||
|
ON
|
||||||
|
BillingEvent.clientId = RegistrarAccount.registrarId
|
||||||
|
AND BillingEvent.currency = RegistrarAccount.currency
|
||||||
|
|
||||||
-- Join to pick up cancellations for billing events.
|
-- Join to pick up cancellations for billing events.
|
||||||
LEFT JOIN EACH (
|
LEFT JOIN EACH (
|
||||||
SELECT
|
SELECT
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue