Implement admin api handlers

This commit is contained in:
2024-11-07 21:32:09 +01:00
parent 24f877e50b
commit 0480c165ae
8 changed files with 333 additions and 5 deletions

View File

@@ -5,6 +5,7 @@ import (
"log"
)
// Migration represents a database migration
type Migration struct {
Version int
SQL string
@@ -78,6 +79,7 @@ var migrations = []Migration{
},
}
// Migrate applies all database migrations
func (db *DB) Migrate() error {
// Create migrations table if it doesn't exist
_, err := db.Exec(`CREATE TABLE IF NOT EXISTS migrations (