aboutsummaryrefslogtreecommitdiff
path: root/src/db/migrations/07-create-balancing-table.sql
diff options
context:
space:
mode:
authorJoris Guyonvarch2026-04-18 11:04:47 +0200
committerJoris Guyonvarch2026-04-18 11:05:17 +0200
commit6d1300640051baa23360846197b54e1e69ae32e3 (patch)
tree46219dcf5b5c9e5da0920ffd966d49ba80947a9b /src/db/migrations/07-create-balancing-table.sql
parentb35589eb90f2e5ee5521964e64eb578e9eb99032 (diff)
Add balancing capabilities
If payment are too unbalanced, it’s easier to make a transfer.
Diffstat (limited to 'src/db/migrations/07-create-balancing-table.sql')
-rw-r--r--src/db/migrations/07-create-balancing-table.sql9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/db/migrations/07-create-balancing-table.sql b/src/db/migrations/07-create-balancing-table.sql
new file mode 100644
index 0000000..148657e
--- /dev/null
+++ b/src/db/migrations/07-create-balancing-table.sql
@@ -0,0 +1,9 @@
+CREATE TABLE IF NOT EXISTS "balancing"(
+ "id" INTEGER PRIMARY KEY,
+ "source" INTEGER NOT NULL REFERENCES "users",
+ "destination" INTEGER NOT NULL REFERENCES "users",
+ "amount" INTEGER NOT NULL,
+ "created_at" TEXT NULL DEFAULT (datetime('now')),
+ "updated_at" TEXT NULL,
+ "deleted_at" TEXT NULL
+) STRICT;