Use golang migrate for migrations

This commit is contained in:
2025-02-22 21:53:12 +01:00
parent aef42ff33c
commit d47f7d7fb0
10 changed files with 220 additions and 141 deletions

View File

@@ -12,6 +12,13 @@ import (
_ "github.com/mattn/go-sqlite3" // SQLite driver
)
type DBType string
const (
DBTypeSQLite DBType = "sqlite3"
DBTypePostgres DBType = "postgres"
)
// UserStore defines the methods for interacting with user data in the database
type UserStore interface {
CreateUser(user *models.User) (*models.User, error)
@@ -108,6 +115,7 @@ func getLogger() logging.Logger {
type database struct {
*sql.DB
secretsService secrets.Service
dbType DBType
}
// Init initializes the database connection