diff options
Diffstat (limited to 'rust/schist_models/migrations/2024-08-31-084439_initial_setup/up.sql')
| -rw-r--r-- | rust/schist_models/migrations/2024-08-31-084439_initial_setup/up.sql | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/rust/schist_models/migrations/2024-08-31-084439_initial_setup/up.sql b/rust/schist_models/migrations/2024-08-31-084439_initial_setup/up.sql index a684ce7..a09bf7b 100644 --- a/rust/schist_models/migrations/2024-08-31-084439_initial_setup/up.sql +++ b/rust/schist_models/migrations/2024-08-31-084439_initial_setup/up.sql @@ -7,6 +7,24 @@ CREATE TABLE accounts( opening_date TEXT NOT NULL ); +CREATE TABLE account_transfers( + id INTEGER NOT NULL PRIMARY KEY, + date TEXT NOT NULL, + description TEXT NOT NULL, + quantity INTEGER NOT NULL, + from_account_id INTEGER NOT NULL, + to_account_id INTEGER NOT NULL, + FOREIGN KEY (from_account_id) + REFERENCES accounts (id) + ON UPDATE CASCADE + ON DELETE RESTRICT, + FOREIGN KEY (to_account_id) + REFERENCES accounts (id) + ON UPDATE CASCADE + ON DELETE RESTRICT +); + + CREATE TABLE budget_drips( id INTEGER NOT NULL PRIMARY KEY, category_id INTEGER NOT NULL, |
