[PR #398] [MERGED] feat: sqlite migrations #586

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

📋 Pull Request Information

Original PR: https://github.com/go-shiori/shiori/pull/398
Author: @fmartingr
Created: 3/12/2022
Status: Merged
Merged: 3/26/2022
Merged by: @fmartingr

Base: masterHead: feat/sqlite-migrations


📝 Commits (1)

📊 Changes

10 files changed (+891 additions, -117 deletions)

View changed files

📝 .gitignore (+5 -1)
📝 go.mod (+5 -5)
📝 go.sum (+784 -57)
internal/cmd/migrate.go (+21 -0)
📝 internal/cmd/root.go (+1 -0)
📝 internal/database/database.go (+3 -0)
internal/database/migrations/sqlite/0001_initial.up.sql (+38 -0)
📝 internal/database/mysql.go (+5 -0)
📝 internal/database/pg.go (+5 -0)
📝 internal/database/sqlite.go (+24 -54)

📄 Description

  • Moved migrations from code to SQL files
  • Using golang-migrate/v4
  • Added a new CLI command: migrate

Test run

  • Create a new database from scratch
  • Use migrate from a 1.5.2 database populated with data
  • Try to migrate a Mysql/PG database should give an error (not implemented)

Closes #392


🔄 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/398 **Author:** [@fmartingr](https://github.com/fmartingr) **Created:** 3/12/2022 **Status:** ✅ Merged **Merged:** 3/26/2022 **Merged by:** [@fmartingr](https://github.com/fmartingr) **Base:** `master` ← **Head:** `feat/sqlite-migrations` --- ### 📝 Commits (1) - [`dc54b45`](https://github.com/go-shiori/shiori/commit/dc54b456a8224a9b7e3f34000a49f1bbdf2964a7) feat: sqlite migrations ### 📊 Changes **10 files changed** (+891 additions, -117 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+5 -1) 📝 `go.mod` (+5 -5) 📝 `go.sum` (+784 -57) ➕ `internal/cmd/migrate.go` (+21 -0) 📝 `internal/cmd/root.go` (+1 -0) 📝 `internal/database/database.go` (+3 -0) ➕ `internal/database/migrations/sqlite/0001_initial.up.sql` (+38 -0) 📝 `internal/database/mysql.go` (+5 -0) 📝 `internal/database/pg.go` (+5 -0) 📝 `internal/database/sqlite.go` (+24 -54) </details> ### 📄 Description - Moved migrations from code to SQL files - Using golang-migrate/v4 - Added a new CLI command: migrate ## Test run - [x] Create a new database from scratch - [x] Use migrate from a 1.5.2 database populated with data - [x] Try to migrate a Mysql/PG database should give an error (not implemented) Closes #392 --- <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:49 +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#586
No description provided.