diff options
Diffstat (limited to 'rust/actualbudget_models')
| -rw-r--r-- | rust/actualbudget_models/src/actualbudget_schema.rs | 25 | ||||
| -rw-r--r-- | rust/actualbudget_models/src/actualbudget_transaction.rs | 10 |
2 files changed, 21 insertions, 14 deletions
diff --git a/rust/actualbudget_models/src/actualbudget_schema.rs b/rust/actualbudget_models/src/actualbudget_schema.rs index a872231..02907c0 100644 --- a/rust/actualbudget_models/src/actualbudget_schema.rs +++ b/rust/actualbudget_models/src/actualbudget_schema.rs @@ -13,22 +13,29 @@ diesel::table! { } diesel::table! { - transactions (id) { + v_transactions (id) { id -> Text, - #[sql_name = "isParent"] is_parent -> Bool, - #[sql_name = "isChild"] is_child -> Bool, - #[sql_name = "acct"] + parent_id -> Nullable<Text>, + #[sql_name = "account"] account_id -> Text, #[sql_name = "category"] - category_id -> Text, + category_id -> Nullable<Text>, amount -> Integer, - #[sql_name = "description"] - payee -> Text, - notes -> Text, + payee -> Nullable<Text>, + notes -> Nullable<Text>, date -> Integer, - parent_id -> Nullable<Text>, + // imported_id -> Text, + // error -> Text, + // imported_payee -> Text, + // starting_balance_flag -> Integer, + // transfer_id -> Text, + // sort_order -> Real, + // cleared -> Integer, + // reconciled -> Integer, + // tombstone -> Integer, + // schedule -> Text, } } diff --git a/rust/actualbudget_models/src/actualbudget_transaction.rs b/rust/actualbudget_models/src/actualbudget_transaction.rs index 2b2f67b..04ece16 100644 --- a/rust/actualbudget_models/src/actualbudget_transaction.rs +++ b/rust/actualbudget_models/src/actualbudget_transaction.rs @@ -3,16 +3,16 @@ use diesel::prelude::{Identifiable, Queryable, QueryableByName, Selectable}; use crate::actualbudget_date::ActualbudgetDate; #[derive(Identifiable, QueryableByName, Queryable, Selectable, Clone)] -#[diesel(table_name = crate::actualbudget_schema::transactions)] +#[diesel(table_name = crate::actualbudget_schema::v_transactions)] pub struct ActualbudgetTransaction { pub id: String, pub is_parent: bool, pub is_child: bool, + pub parent_id: Option<String>, pub account_id: String, - pub category_id: String, + pub category_id: Option<String>, pub amount: i32, - pub payee: String, - pub notes: String, + pub payee: Option<String>, + pub notes: Option<String>, pub date: ActualbudgetDate, - pub parent_id: Option<String>, } |
