Skip to content

Commit d7872b7

Browse files
committed
Add is_closed column in the orders table
Signed-off-by: popcorny <celu@infuseai.io>
1 parent 8d75fcf commit d7872b7

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

models/orders.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ final as (
3636
orders.customer_id,
3737
orders.order_date,
3838
orders.status,
39+
orders.is_closed,
3940

4041
{% for payment_method in payment_methods -%}
4142

@@ -50,7 +51,7 @@ final as (
5051

5152
left join order_payments
5253
on orders.order_id = order_payments.order_id
53-
54+
where is_closed = true
5455
)
5556

5657
select * from final

models/staging/stg_orders.sql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ renamed as (
1414
id as order_id,
1515
user_id as customer_id,
1616
order_date,
17-
status
18-
17+
status,
18+
status = 'completed' as is_closed
1919
from source
20-
2120
)
2221

2322
select * from renamed

0 commit comments

Comments
 (0)