Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 23, 2025
1 parent 6db3c25 commit c189e93
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions sqlite_export_for_ynab/ddl/create-relations.sql
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,8 @@ CREATE TABLE IF NOT EXISTS subtransactions (

CREATE VIEW IF NOT EXISTS flat_transactions AS
SELECT
COALESCE(st.id, t.id) AS id,
t.id AS transaction_id,
st.id AS subtransaction_id,
CASE when st.id is not null then t.id end as parent_transaction_id,
t.budget_id,
t.account_id,
t.account_name,
Expand All @@ -152,15 +150,17 @@ SELECT
t.import_payee_name,
t.import_payee_name_original,
t.matched_transaction_id,
COALESCE(st.id, t.id) AS id,
CASE WHEN st.id IS NOT null THEN t.id END AS parent_transaction_id,
COALESCE(st.amount, t.amount) AS amount,
CASE
WHEN
COALESCE(st.transfer_account_id, t.transfer_account_id) IS NOT NULL
COALESCE(st.transfer_account_id, t.transfer_account_id) IS NOT null
THEN COALESCE(st.category_id, t.category_id)
END AS category_id,
CASE
WHEN
COALESCE(st.transfer_account_id, t.transfer_account_id) IS NOT NULL
COALESCE(st.transfer_account_id, t.transfer_account_id) IS NOT null
THEN COALESCE(st.category_name, t.category_name)
END AS category_name,
COALESCE(st.deleted, t.deleted) AS deleted,
Expand Down Expand Up @@ -224,10 +224,8 @@ CREATE TABLE IF NOT EXISTS scheduled_subtransactions (

CREATE VIEW IF NOT EXISTS scheduled_flat_transactions AS
SELECT
COALESCE(st.id, t.id) AS id,
t.id AS transaction_id,
st.id AS subtransaction_id,
CASE when st.id is not null then t.id end as parent_transaction_id,
t.budget_id,
t.account_id,
t.account_name,
Expand All @@ -236,15 +234,17 @@ SELECT
t.flag_color,
t.flag_name,
p.name AS payee_name,
COALESCE(st.id, t.id) AS id,
CASE WHEN st.id IS NOT null THEN t.id END AS parent_transaction_id,
COALESCE(st.amount, t.amount) AS amount,
CASE
WHEN
COALESCE(st.transfer_account_id, t.transfer_account_id) IS NOT NULL
COALESCE(st.transfer_account_id, t.transfer_account_id) IS NOT null
THEN COALESCE(st.category_id, t.category_id)
END AS category_id,
CASE
WHEN
COALESCE(st.transfer_account_id, t.transfer_account_id) IS NOT NULL
COALESCE(st.transfer_account_id, t.transfer_account_id) IS NOT null
THEN c.name
END AS category_name,
COALESCE(st.deleted, t.deleted) AS deleted,
Expand Down

0 comments on commit c189e93

Please sign in to comment.