User repository (#3795)
* It builds with the new user repository * fix(test): fix broken test * fix(api): fix registration endpoint that was broken after the change * fix(test): update test to reflect new user repository * fix: use interface type instead of concrete type * fix: restore commented out code
This commit is contained in:
@@ -11,6 +11,8 @@ import (
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/owncast/owncast/persistence/tables"
|
||||
|
||||
"github.com/owncast/owncast/config"
|
||||
"github.com/owncast/owncast/utils"
|
||||
log "github.com/sirupsen/logrus"
|
||||
@@ -74,8 +76,8 @@ func SetupPersistence(file string) error {
|
||||
_, _ = db.Exec("pragma wal_checkpoint(full)")
|
||||
|
||||
createWebhooksTable()
|
||||
createUsersTable(db)
|
||||
createAccessTokenTable(db)
|
||||
tables.CreateUsersTable(db)
|
||||
tables.CreateAccessTokenTable(db)
|
||||
|
||||
if _, err := db.Exec(`CREATE TABLE IF NOT EXISTS config (
|
||||
"key" string NOT NULL PRIMARY KEY,
|
||||
@@ -108,7 +110,7 @@ func SetupPersistence(file string) error {
|
||||
|
||||
// is database schema outdated?
|
||||
if version < schemaVersion {
|
||||
if err := migrateDatabaseSchema(db, version, schemaVersion); err != nil {
|
||||
if err := tables.MigrateDatabaseSchema(db, version, schemaVersion); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user