Skip to content

Commit 6fba370

Browse files
committed
Fixes #1442 fails to start on empty DB
1 parent 4b7bc48 commit 6fba370

File tree

3 files changed

+25
-18
lines changed

3 files changed

+25
-18
lines changed

ChangeLog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2025-08-20 Lars Windolf <lars.windolf@gmx.de>
2+
3+
Version 1.16.1
4+
5+
* Fix #1442: Fails to start on empty database
6+
(reported by bbhtt)
7+
8+
19
2025-08-13 Lars Windolf <lars.windolf@gmx.de>
210

311
Version 1.16.0

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dnl Process this file with autoconf to produce a configure script.
22

3-
AC_INIT([liferea],[1.16.0],[liferea-devel@lists.sourceforge.net])
3+
AC_INIT([liferea],[1.16.1],[liferea-devel@lists.sourceforge.net])
44
AC_CANONICAL_HOST
55
AC_CONFIG_SRCDIR([src/feedlist.c])
66

src/db.c

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,9 @@ db_init (void)
348348
"DROP TABLE items; "
349349
"CREATE TABLE items ("
350350
" item_id INTEGER,"
351-
" parent_item_id INTEGER,"
351+
" parent_item_id INTEGER,"
352352
" node_id TEXT,"
353-
" parent_node_id TEXT,"
353+
" parent_node_id TEXT,"
354354
" title TEXT,"
355355
" read INTEGER,"
356356
" updated INTEGER,"
@@ -362,8 +362,8 @@ db_init (void)
362362
" description TEXT,"
363363
" date INTEGER,"
364364
" comment_feed_id INTEGER,"
365-
" comment INTEGER,"
366-
" PRIMARY KEY (item_id)"
365+
" comment INTEGER,"
366+
" PRIMARY KEY (item_id)"
367367
");"
368368
"INSERT INTO items SELECT itemsets.item_id, parent_item_id, node_id, parent_node_id, title, itemsets.read, updated, popup, marked, source, source_id, valid_guid, description, date, comment_feed_id, itemsets.comment FROM items_backup JOIN itemsets ON itemsets.item_id = items_backup.item_id; "
369369
"DROP TABLE items_backup; "
@@ -382,11 +382,11 @@ db_init (void)
382382
db_exec ("BEGIN; "
383383
"DROP TABLE view_state; "
384384
"DROP TABLE update_state; "
385-
"CREATE TABLE search_folder_items ("
386-
" node_id STRING,"
385+
"CREATE TABLE search_folder_items ("
386+
" node_id STRING,"
387387
" item_id INTEGER,"
388-
" PRIMARY KEY (node_id, item_id)"
389-
");"
388+
" PRIMARY KEY (node_id, item_id)"
389+
");"
390390
"REPLACE INTO info (name, value) VALUES ('schemaVersion',9); "
391391
"END;" );
392392

@@ -417,12 +417,12 @@ db_init (void)
417417
/* A parent node id to search folder relation to allow cleanups */
418418
db_exec ("BEGIN; "
419419
"DROP TABLE search_folder_items; "
420-
"CREATE TABLE search_folder_items ("
421-
" node_id STRING,"
422-
" parent_node_id STRING,"
420+
"CREATE TABLE search_folder_items ("
421+
" node_id STRING,"
422+
" parent_node_id STRING,"
423423
" item_id INTEGER,"
424-
" PRIMARY KEY (node_id, item_id)"
425-
");"
424+
" PRIMARY KEY (node_id, item_id)"
425+
");"
426426
"REPLACE INTO info (name, value) VALUES ('schemaVersion',10); "
427427
"END;" );
428428

@@ -472,9 +472,9 @@ db_init (void)
472472
/* 1. Create tables if they do not exist yet */
473473
db_exec ("CREATE TABLE items ("
474474
" item_id INTEGER PRIMARY KEY AUTOINCREMENT,"
475-
" parent_item_id INTEGER,"
475+
" parent_item_id INTEGER,"
476476
" node_id TEXT," /* FIXME: migrate node ids to real integers */
477-
" parent_node_id TEXT," /* FIXME: migrate node ids to real integers */
477+
" parent_node_id TEXT," /* FIXME: migrate node ids to real integers */
478478
" title TEXT,"
479479
" read INTEGER,"
480480
" updated INTEGER,"
@@ -486,8 +486,7 @@ db_init (void)
486486
" description TEXT,"
487487
" date INTEGER,"
488488
" comment_feed_id TEXT,"
489-
" comment INTEGER,"
490-
" PRIMARY KEY (item_id)"
489+
" comment INTEGER"
491490
");");
492491

493492
db_exec ("CREATE INDEX items_idx ON items (source_id);");

0 commit comments

Comments
 (0)