48/add-complete #53

Merged
seeseemelk merged 5 commits from 48/add-complete into main 2025-05-18 08:00:29 +02:00
2 changed files with 5 additions and 3 deletions
Showing only changes of commit d9521fc59b - Show all commits

View File

@ -114,7 +114,7 @@ func (db *Db) CreateAllowance(userId int, allowance *CreateAllowanceRequest) (in
defer tx.MustRollback()
// Insert the new allowance
err = tx.Query("insert into allowances (user_id, name, target, progress, weight) values (?, ?, ?, 0, ?)").
err = tx.Query("insert into allowances (user_id, name, target, weight) values (?, ?, ?, ?)").
Bind(userId, allowance.Name, allowance.Target, allowance.Weight).
Exec()

View File

@ -1,7 +1,9 @@
create table users
(
id integer primary key,
name text not null
name text not null,
weight real not null default 1.0,
balance integer not null default 0
) strict;
create table history
@ -18,7 +20,7 @@ create table allowances
user_id integer not null,
name text not null,
target integer not null,
progress integer not null,
progress integer not null default 0,
weight real not null
);