first table reading from sync_core

This commit is contained in:
Pablo Martin 2024-01-18 12:20:14 +01:00
parent 727431b7b2
commit 8341125c78
5 changed files with 52 additions and 0 deletions

8
models/sources.yml Normal file
View file

@ -0,0 +1,8 @@
version: 2
sources:
- name: core
schema: sync_core
tables:
- name: user
identifier: User

View file

@ -0,0 +1,23 @@
with raw_user as (select * from {{ source("core", "user") }})
select
"Id" as id_user,
code as user_code,
"Name" as name,
email as email,
title as title,
dealid as id_deal,
deleted as is_deleted,
joindate as join_date_utc,
username as username,
codeprefix as code_prefix,
billingtown as billing_town,
companyname as company_name,
emailconfirmed as is_email_confirmed,
lockoutenabled as is_lockout_enabled,
billingpostcode as billing_postcode,
billingcountryid as id_billing_country,
twofactorenabled as is_twofactor_enabled,
accessfailedcount as access_failed_count,
lockoutenddateutc as lockout_end_date_utc,
billingcountryname as billing_country_name
from raw_user