Compare commits

..

2 Commits

Author SHA1 Message Date
e51915d1cd Include author field when updating the database 2022-12-28 14:25:56 +01:00
3a654f6ede Migrate the database table 2022-12-28 14:25:34 +01:00
4 changed files with 9 additions and 2 deletions

View File

@ -511,6 +511,7 @@ class Repository(
item.link, item.link,
item.sourcetitle, item.sourcetitle,
item.tags.joinToString(","), item.tags.joinToString(","),
item.author,
item.id.toString() item.id.toString()
) )

View File

@ -1 +1 @@
ALTER TABLE ITEM ADD COLUMN `author` TEXT; ALTER TABLE ITEM ADD COLUMN `author` TEXT NOT NULL;

View File

@ -0,0 +1,6 @@
CREATE TABLE ITEM_BACKUP AS SELECT `id`, `datetime`, `title`, `content`,
`unread`, `starred`, `thumbnail`, `icon`, `link`, `sourcetitle`,
`tags` FROM ITEM;
ALTER TABLE ITEM_BACKUP ADD COLUMN `author` TEXT;
DROP TABLE ITEM;
ALTER TABLE ITEM_BACKUP RENAME TO ITEM;

View File

@ -31,4 +31,4 @@ deleteItemsWhereSource:
DELETE FROM ITEM WHERE `sourcetitle` = ?; DELETE FROM ITEM WHERE `sourcetitle` = ?;
updateItem: updateItem:
UPDATE ITEM SET `datetime` = ?, `title` = ?, `content` = ?, `unread` = ?, `starred` = ?, `thumbnail` = ?, `icon` = ?, `link` = ?, `sourcetitle` = ?, `tags` = ? WHERE `id` = ?; UPDATE ITEM SET `datetime` = ?, `title` = ?, `content` = ?, `unread` = ?, `starred` = ?, `thumbnail` = ?, `icon` = ?, `link` = ?, `sourcetitle` = ?, `tags` = ?, `author` = ? WHERE `id` = ?;