-- IMPORTS
WITH users AS (
    SELECT * FROM {{ source('src_exchange_mysql', 'users') }}
),


-- LOGIC
users_rename AS (

    SELECT
        users.id,
        users.name,
        users.email,
        users.type                                                                                      AS user_type,
        users.status,
        users.remember_token,
        users.active_at,
        users.deleted_at,
        users.created_at,
        users.updated_at,
        current_timestamp()                                                                              AS _dbt_ran_at

    FROM users
),


-- FINAL
final__base_exchange__users AS (

    SELECT
        id,
        name,
        email,
        user_type,
        status,
        remember_token,
        active_at,
        deleted_at,
        created_at,
        updated_at,
        _dbt_ran_at

    FROM users_rename

) 

SELECT * FROM final__base_exchange__users