feat: Added migration tool

This commit is contained in:
2025-08-11 18:58:52 +03:00
parent e5aadbe9c8
commit 40a313f93b
6 changed files with 100 additions and 17 deletions

11
main.go
View File

@@ -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
}