feat: Added migration tool
This commit is contained in:
11
main.go
11
main.go
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"git.ostiwe.com/ostiwe-com/status/migration"
|
||||
appLog "git.ostiwe.com/ostiwe-com/status/modules/log"
|
||||
"git.ostiwe.com/ostiwe-com/status/pkg/args"
|
||||
"git.ostiwe.com/ostiwe-com/status/router"
|
||||
@@ -18,7 +19,17 @@ var appArgs args.AppArgs
|
||||
func main() {
|
||||
arg.MustParse(&appArgs)
|
||||
|
||||
if appArgs.Migration != nil && appArgs.Migration.Create != nil {
|
||||
if err := migration.CreateMigration(appArgs.Migration.Create.Name); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
if appArgs.Server != nil {
|
||||
migration.RunMigration()
|
||||
|
||||
server.Run(appArgs.Server)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user