Moved database migrations for MySQL dialect into approriate package.
This commit is contained in:
parent
400ce0db0c
commit
b6556d6e90
@ -35,7 +35,6 @@ import (
|
||||
"gitlab.com/pztrn/fastpastebin/captcha"
|
||||
"gitlab.com/pztrn/fastpastebin/context"
|
||||
"gitlab.com/pztrn/fastpastebin/database"
|
||||
"gitlab.com/pztrn/fastpastebin/database/migrations"
|
||||
"gitlab.com/pztrn/fastpastebin/pastes"
|
||||
"gitlab.com/pztrn/fastpastebin/templater"
|
||||
)
|
||||
@ -56,8 +55,6 @@ func main() {
|
||||
c.LoadConfiguration()
|
||||
database.New(c)
|
||||
c.Database.Initialize()
|
||||
migrations.New(c)
|
||||
migrations.Migrate()
|
||||
templater.Initialize(c)
|
||||
api.New(c)
|
||||
api.InitializeAPI()
|
||||
|
@ -30,6 +30,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
// local
|
||||
"gitlab.com/pztrn/fastpastebin/database/dialects/mysql/migrations"
|
||||
"gitlab.com/pztrn/fastpastebin/pastes/model"
|
||||
|
||||
// other
|
||||
@ -145,6 +146,10 @@ func (db *Database) Initialize() {
|
||||
|
||||
c.Logger.Info().Msg("Database connection established")
|
||||
db.db = dbConn
|
||||
|
||||
// Perform migrations.
|
||||
migrations.New(c)
|
||||
migrations.Migrate()
|
||||
}
|
||||
|
||||
func (db *Database) SavePaste(p *pastesmodel.Paste) (int64, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user