From: Olaf Wintermann Date: Mon, 2 Jun 2025 16:28:28 +0000 (+0200) Subject: insert value for position when creating new notebooks X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;h=2324e4615a686d5d4eeeb5ac86e3f4db11ce941f;p=note.git insert value for position when creating new notebooks --- diff --git a/application/store.c b/application/store.c index d1a3706..6f2f231 100644 --- a/application/store.c +++ b/application/store.c @@ -98,8 +98,8 @@ "(?, ?, 1) returning resource_id;" #define SQL_NOTEBOOK_NEW \ - "insert into notebooks(resource_id) values " \ - "(?) returning notebook_id;" + "insert into notebooks(resource_id, position) " \ + "(?, (select coalesce(max(position), 0)+1 from notebooks)) returning notebook_id;" static DBUConnection *connection;