mirror of
https://github.com/jc21/nginx-proxy-manager.git
synced 2024-08-30 18:22:48 +00:00
Skip auto dumping database migration
Fix user id from context
This commit is contained in:
parent
cbcb0cc0f8
commit
dde368f733
@ -64,7 +64,7 @@ func CreateAccessList() func(http.ResponseWriter, *http.Request) {
|
||||
}
|
||||
|
||||
// Get userID from token
|
||||
userID, _ := r.Context().Value(c.UserIDCtxKey).(int)
|
||||
userID, _ := r.Context().Value(c.UserIDCtxKey).(uint)
|
||||
newItem.UserID = userID
|
||||
|
||||
if err = newItem.Save(); err != nil {
|
||||
|
@ -70,7 +70,7 @@ func CreateDNSProvider() func(http.ResponseWriter, *http.Request) {
|
||||
}
|
||||
|
||||
// Get userID from token
|
||||
userID, _ := r.Context().Value(c.UserIDCtxKey).(int)
|
||||
userID, _ := r.Context().Value(c.UserIDCtxKey).(uint)
|
||||
newItem.UserID = userID
|
||||
|
||||
if err = newItem.Save(); err != nil {
|
||||
|
@ -68,7 +68,7 @@ func CreateNginxTemplate() func(http.ResponseWriter, *http.Request) {
|
||||
}
|
||||
|
||||
// Get userID from token
|
||||
userID, _ := r.Context().Value(c.UserIDCtxKey).(int)
|
||||
userID, _ := r.Context().Value(c.UserIDCtxKey).(uint)
|
||||
newNginxTemplate.UserID = userID
|
||||
|
||||
if err = newNginxTemplate.Save(); err != nil {
|
||||
|
@ -68,7 +68,7 @@ func CreateStream() func(http.ResponseWriter, *http.Request) {
|
||||
}
|
||||
|
||||
// Get userID from token
|
||||
userID, _ := r.Context().Value(c.UserIDCtxKey).(int)
|
||||
userID, _ := r.Context().Value(c.UserIDCtxKey).(uint)
|
||||
newHost.UserID = userID
|
||||
|
||||
if err = newHost.Save(); err != nil {
|
||||
|
@ -20,6 +20,7 @@ func Migrate(followup afterMigrationComplete) bool {
|
||||
dbURL := config.Configuration.DB.GetDBMateConnectURL()
|
||||
u, _ := url.Parse(dbURL)
|
||||
db := dbmate.New(u)
|
||||
db.AutoDumpSchema = false
|
||||
db.FS = embed.MigrationFiles
|
||||
db.MigrationsDir = []string{fmt.Sprintf("./migrations/%s", config.Configuration.DB.GetDriver())}
|
||||
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
// Model is the model
|
||||
type Model struct {
|
||||
entity.ModelBase
|
||||
UserID int `json:"user_id" gorm:"column:user_id" filter:"user_id,integer"`
|
||||
UserID uint `json:"user_id" gorm:"column:user_id" filter:"user_id,integer"`
|
||||
Name string `json:"name" gorm:"column:name" filter:"name,string"`
|
||||
Meta types.JSONB `json:"meta" gorm:"column:meta"`
|
||||
// Expansions
|
||||
|
@ -15,7 +15,7 @@ import (
|
||||
// Model is the model
|
||||
type Model struct {
|
||||
entity.ModelBase
|
||||
UserID int `json:"user_id" gorm:"column:user_id" filter:"user_id,integer"`
|
||||
UserID uint `json:"user_id" gorm:"column:user_id" filter:"user_id,integer"`
|
||||
Name string `json:"name" gorm:"column:name" filter:"name,string"`
|
||||
AcmeshName string `json:"acmesh_name" gorm:"column:acmesh_name" filter:"acmesh_name,string"`
|
||||
DNSSleep int `json:"dns_sleep" gorm:"column:dns_sleep" filter:"dns_sleep,integer"`
|
||||
|
@ -10,7 +10,7 @@ import (
|
||||
// Model is the model
|
||||
type Model struct {
|
||||
entity.ModelBase
|
||||
UserID int `json:"user_id" gorm:"column:user_id" filter:"user_id,integer"`
|
||||
UserID uint `json:"user_id" gorm:"column:user_id" filter:"user_id,integer"`
|
||||
Name string `json:"name" gorm:"column:name" filter:"name,string"`
|
||||
Type string `json:"type" gorm:"column:type" filter:"type,string"`
|
||||
Template string `json:"template" gorm:"column:template" filter:"template,string"`
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
type Model struct {
|
||||
entity.ModelBase
|
||||
ExpiresOn types.DBDate `json:"expires_on" gorm:"column:expires_on" filter:"expires_on,integer"`
|
||||
UserID int `json:"user_id" gorm:"column:user_id" filter:"user_id,integer"`
|
||||
UserID uint `json:"user_id" gorm:"column:user_id" filter:"user_id,integer"`
|
||||
Provider string `json:"provider" gorm:"column:provider" filter:"provider,string"`
|
||||
Name string `json:"name" gorm:"column:name" filter:"name,string"`
|
||||
DomainNames types.JSONB `json:"domain_names" gorm:"column:domain_names" filter:"domain_names,string"`
|
||||
|
Loading…
Reference in New Issue
Block a user