Refactored src and dst account to just account in preparation for a "counter party", instead of a full account.
This commit is contained in:
@@ -32,10 +32,9 @@ where
|
||||
SELECT
|
||||
id,
|
||||
name,
|
||||
account_id,
|
||||
amount_cents,
|
||||
direction,
|
||||
source_account_id,
|
||||
destination_account_id,
|
||||
starts_at,
|
||||
ends_at,
|
||||
recurrence_every,
|
||||
@@ -66,10 +65,9 @@ where
|
||||
SELECT
|
||||
id,
|
||||
name,
|
||||
account_id,
|
||||
amount_cents,
|
||||
direction,
|
||||
source_account_id,
|
||||
destination_account_id,
|
||||
starts_at,
|
||||
ends_at,
|
||||
recurrence_every,
|
||||
@@ -97,23 +95,21 @@ where
|
||||
INSERT INTO recurring_transactions (
|
||||
id,
|
||||
name,
|
||||
account_id,
|
||||
amount_cents,
|
||||
direction,
|
||||
source_account_id,
|
||||
destination_account_id,
|
||||
starts_at,
|
||||
ends_at,
|
||||
recurrence_every,
|
||||
recurrence_unit,
|
||||
weekend_adjustment
|
||||
)
|
||||
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)
|
||||
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)
|
||||
ON CONFLICT (id) DO UPDATE SET
|
||||
name = EXCLUDED.name,
|
||||
account_id = EXCLUDED.account_id,
|
||||
amount_cents = EXCLUDED.amount_cents,
|
||||
direction = EXCLUDED.direction,
|
||||
source_account_id = EXCLUDED.source_account_id,
|
||||
destination_account_id = EXCLUDED.destination_account_id,
|
||||
starts_at = EXCLUDED.starts_at,
|
||||
ends_at = EXCLUDED.ends_at,
|
||||
recurrence_every = EXCLUDED.recurrence_every,
|
||||
@@ -123,10 +119,9 @@ where
|
||||
old_row.id AS "old_id?",
|
||||
new_row.id AS "id!",
|
||||
new_row.name AS "name!",
|
||||
new_row.account_id AS "account_id!",
|
||||
new_row.amount_cents AS "amount_cents!",
|
||||
new_row.direction AS "direction!",
|
||||
new_row.source_account_id AS "source_account_id?",
|
||||
new_row.destination_account_id AS "destination_account_id?",
|
||||
new_row.starts_at AS "starts_at!",
|
||||
new_row.ends_at AS "ends_at?",
|
||||
new_row.recurrence_every AS "recurrence_every!",
|
||||
@@ -135,10 +130,9 @@ where
|
||||
"#,
|
||||
transaction.id,
|
||||
transaction.name,
|
||||
transaction.account_id,
|
||||
transaction.amount_cents,
|
||||
transaction.direction,
|
||||
transaction.source_account_id,
|
||||
transaction.destination_account_id,
|
||||
transaction.starts_at,
|
||||
transaction.ends_at,
|
||||
transaction.recurrence_every,
|
||||
@@ -152,10 +146,9 @@ where
|
||||
let transaction = RecurringTransactionRow {
|
||||
id: row.id,
|
||||
name: row.name,
|
||||
account_id: row.account_id,
|
||||
amount_cents: row.amount_cents,
|
||||
direction: row.direction,
|
||||
source_account_id: row.source_account_id,
|
||||
destination_account_id: row.destination_account_id,
|
||||
starts_at: row.starts_at,
|
||||
ends_at: row.ends_at,
|
||||
recurrence_every: row.recurrence_every,
|
||||
|
||||
Reference in New Issue
Block a user