Added migrations for mysql and postgres, added ci testing suites for them

This commit is contained in:
Jamie Curnow
2023-05-30 13:26:46 +10:00
parent e0773b1c06
commit 3c1b4fdf34
13 changed files with 1266 additions and 41 deletions

View File

@ -18,7 +18,7 @@ type db struct {
Username string `json:"username" envconfig:"optional,default="`
Password string `json:"password" envconfig:"optional,default="`
Name string `json:"name" envconfig:"optional,default="`
SSLMode string `json:"sslmode" envconfig:"optional,default=deisable"`
SSLMode string `json:"sslmode" envconfig:"optional,default=disable"`
}
// GetDriver returns the lowercase driver name

View File

@ -9,6 +9,7 @@ import (
"npm/internal/logger"
"github.com/amacneil/dbmate/v2/pkg/dbmate"
_ "github.com/amacneil/dbmate/v2/pkg/driver/mysql"
_ "github.com/amacneil/dbmate/v2/pkg/driver/postgres"
_ "github.com/amacneil/dbmate/v2/pkg/driver/sqlite"
)

View File

@ -16,7 +16,7 @@ type KeysModel struct {
// TableName overrides the table name used by gorm
func (KeysModel) TableName() string {
return "keys"
return "jwt_keys"
}
// LoadByID will load from an ID