From: Olaf Wintermann Date: Mon, 2 Jun 2025 17:07:02 +0000 (+0200) Subject: order noteobooks by position X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;h=6c5bea4d45d158e9e793a9409b23be05a5dfb144;p=note.git order noteobooks by position --- diff --git a/application/store.c b/application/store.c index 6f2f231..c70071a 100644 --- a/application/store.c +++ b/application/store.c @@ -55,7 +55,7 @@ ")\n" \ "select n.*, r.resource_id as [__resources__resource_id], r.* from cols r\n" \ "left join notebooks n on r.resource_id = n.resource_id\n" \ - "order by path;" + "order by depth, position;" #define SQL_NOTEBOOK_GET_NOTES \ "select n.*, r.resource_id as [__resources__resource_id], r.parent_id, " \ @@ -799,6 +799,8 @@ typedef struct CreateNotebookJob { } CreateNotebookJob; static int qthr_new_notebook(CreateNotebookJob *job) { + // TODO: maybe use transactions + DBUQuery *q = connection->createQuery(connection, NULL); dbuQuerySetSQL(q, SQL_NOTEBOOK_RES_NEW); dbuQuerySetParamInt64(q, 1, job->resource->parent_id);