[PR #372] [MERGED] Remove unneeded alter table transactions from sqlite #576

Closed
opened 2026-02-25 23:34:47 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-shiori/shiori/pull/372
Author: @n8225
Created: 2/14/2022
Status: Merged
Merged: 2/14/2022
Merged by: @fmartingr

Base: masterHead: sqlite_dupColumn_fix


📝 Commits (1)

  • ad62b1e Remove unneeded alter table transactions from sqlite

📊 Changes

1 file changed (+0 additions, -8 deletions)

View changed files

📝 internal/database/sqlite.go (+0 -8)

📄 Description

Receive the following errors on startup after #367.

2022/02/14 11:23:42 error during database alert: SQL logic error: duplicate column name: owner (1)
2022/02/14 11:23:42 error during database alert: SQL logic error: duplicate column name: public (1)

Although these errors can be safely ignored since the columns exist, I think it would be safe to remove the alter table commands. The owner column was added to the account table in commit 0c4d75f773 and the public column was added to the bookmark table in commit 20e89216f0 both over 2 years ago. The only way I could see the removal being an issue is if the sqlite database was created before either of those commits and the tables haven't been updated by a later version. (In this case specify required migration path of current version in use -> v1.5.0 -> latest)

Alternatively, I believe we could use something along the lines of https://github.com/golang-migrate/migrate to ensure tables are setup correctly, might be beneficial in the future as well.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-shiori/shiori/pull/372 **Author:** [@n8225](https://github.com/n8225) **Created:** 2/14/2022 **Status:** ✅ Merged **Merged:** 2/14/2022 **Merged by:** [@fmartingr](https://github.com/fmartingr) **Base:** `master` ← **Head:** `sqlite_dupColumn_fix` --- ### 📝 Commits (1) - [`ad62b1e`](https://github.com/go-shiori/shiori/commit/ad62b1e3b2f4ee23ff98d0200c46f64433055964) Remove unneeded alter table transactions from sqlite ### 📊 Changes **1 file changed** (+0 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `internal/database/sqlite.go` (+0 -8) </details> ### 📄 Description Receive the following errors on startup after #367. ``` 2022/02/14 11:23:42 error during database alert: SQL logic error: duplicate column name: owner (1) 2022/02/14 11:23:42 error during database alert: SQL logic error: duplicate column name: public (1) ``` Although these errors can be safely ignored since the columns exist, I think it would be safe to remove the alter table commands. The `owner` column was added to the `account` table in commit 0c4d75f77390ac2d2ba7a9436e2c2bc9b7102dd5 and the `public` column was added to the `bookmark` table in commit 20e89216f0b594e7aed231c5a31a71120d6ffba4 both over 2 years ago. The only way I could see the removal being an issue is if the sqlite database was created before either of those commits and the tables haven't been updated by a later version. (In this case specify required migration path of current version in use -> v1.5.0 -> latest) Alternatively, I believe we could use something along the lines of https://github.com/golang-migrate/migrate to ensure tables are setup correctly, might be beneficial in the future as well. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 23:34:47 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shiori#576
No description provided.