diff options
| author | Joe Carstairs <me@joeac.net> | 2026-01-17 08:34:18 +0000 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-01-17 16:43:36 +0000 |
| commit | 0971a7a4e847a5ae935c164d8d63c18d803ddc70 (patch) | |
| tree | e177150729e6547c271e4d27dd31a5f2ca27d484 /schist_core | |
| parent | fa1d9941e2d3969a1035d36c97f3363628a409c0 (diff) | |
BucketTransaction has date field
Diffstat (limited to 'schist_core')
| -rw-r--r-- | schist_core/schist_fakes/src/bucket_transaction.rs | 6 | ||||
| -rw-r--r-- | schist_core/schist_models/migrations/2024-08-31-084439_initial_setup/up.sql | 1 | ||||
| -rw-r--r-- | schist_core/schist_models/src/bucket_transaction.rs | 3 | ||||
| -rw-r--r-- | schist_core/schist_models/src/schema.rs | 1 | ||||
| -rw-r--r-- | schist_core/schist_models/user_data.sqlite | bin | 49152 -> 0 bytes |
5 files changed, 10 insertions, 1 deletions
diff --git a/schist_core/schist_fakes/src/bucket_transaction.rs b/schist_core/schist_fakes/src/bucket_transaction.rs index 3dd0a6f..aecc057 100644 --- a/schist_core/schist_fakes/src/bucket_transaction.rs +++ b/schist_core/schist_fakes/src/bucket_transaction.rs @@ -1,4 +1,7 @@ -use schist_models::{BucketTransaction, BucketTransactionBuilder}; +use schist_models::{ + bucket_transaction::{BucketTransaction, BucketTransactionBuilder}, + date_utc::DateUtc, +}; pub fn make_fake_bucket_transaction(id: i32) -> BucketTransaction { make_fake_bucket_transaction_builder(id).build().unwrap() @@ -10,6 +13,7 @@ pub fn make_fake_bucket_transaction_builder(id: i32) -> BucketTransactionBuilder .id(id) .description(String::from("Fake bucket transaction")) .amount(0) + .date(DateUtc::from_ymd(1970, 1, 1).unwrap()) .bucket_id(1); builder } diff --git a/schist_core/schist_models/migrations/2024-08-31-084439_initial_setup/up.sql b/schist_core/schist_models/migrations/2024-08-31-084439_initial_setup/up.sql index e645d43..da85b33 100644 --- a/schist_core/schist_models/migrations/2024-08-31-084439_initial_setup/up.sql +++ b/schist_core/schist_models/migrations/2024-08-31-084439_initial_setup/up.sql @@ -36,6 +36,7 @@ CREATE TABLE bucket_transactions( id INTEGER NOT NULL PRIMARY KEY, amount INTEGER NOT NULL, bucket_id INTEGER NOT NULL, + date TEXT NOT NULL, description TEXT NOT NULL, FOREIGN KEY (bucket_id) REFERENCES buckets (id) diff --git a/schist_core/schist_models/src/bucket_transaction.rs b/schist_core/schist_models/src/bucket_transaction.rs index 2aeae8a..a956d0b 100644 --- a/schist_core/schist_models/src/bucket_transaction.rs +++ b/schist_core/schist_models/src/bucket_transaction.rs @@ -1,11 +1,14 @@ use derive_builder::Builder; use diesel::prelude::*; +use crate::date_utc::DateUtc; + #[derive(Builder, Queryable, Identifiable, Selectable, Debug, PartialEq, Insertable)] #[diesel(table_name = crate::schema::bucket_transactions)] pub struct BucketTransaction { pub id: i32, pub amount: i32, pub bucket_id: i32, + pub date: DateUtc, pub description: String, } diff --git a/schist_core/schist_models/src/schema.rs b/schist_core/schist_models/src/schema.rs index 8744696..9579e5c 100644 --- a/schist_core/schist_models/src/schema.rs +++ b/schist_core/schist_models/src/schema.rs @@ -25,6 +25,7 @@ diesel::table! { id -> Integer, amount -> Integer, bucket_id -> Integer, + date -> Text, description -> Text, } } diff --git a/schist_core/schist_models/user_data.sqlite b/schist_core/schist_models/user_data.sqlite Binary files differdeleted file mode 100644 index 81fd25c..0000000 --- a/schist_core/schist_models/user_data.sqlite +++ /dev/null |
