From 302ceaa629e9885faa5fd9ffb27a84992d73d031 Mon Sep 17 00:00:00 2001 From: Sebastiaan de Schaetzen Date: Sun, 25 May 2025 15:07:51 +0200 Subject: [PATCH] Update default allowance, but differently (#84) Reviewed-on: https://gitea.seeseepuff.be/seeseemelk/allowance_planner_2000/pulls/84 --- backend/migrations/1_initial.sql | 2 +- backend/migrations/3_change_weight_default.sql | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/backend/migrations/1_initial.sql b/backend/migrations/1_initial.sql index d400ec8..ec66af4 100644 --- a/backend/migrations/1_initial.sql +++ b/backend/migrations/1_initial.sql @@ -2,7 +2,7 @@ create table users ( id integer primary key, name text not null, - weight real not null default 0.0, + weight real not null default 10.0, balance integer not null default 0 ) strict; diff --git a/backend/migrations/3_change_weight_default.sql b/backend/migrations/3_change_weight_default.sql index aa5d336..0599a2c 100644 --- a/backend/migrations/3_change_weight_default.sql +++ b/backend/migrations/3_change_weight_default.sql @@ -1,4 +1 @@ -alter table users rename column weight to weight_old; -alter table users add column weight real not null default 10.0; -update users set weight = weight_old; -alter table users drop column weight_old; +update users set weight = 10.0 where weight = 0.0;