Init commit repo setup

This commit is contained in:
Lokesh Dugar
2024-07-23 14:16:26 +05:30
parent 72157608cd
commit 2012cd8940
29 changed files with 1012 additions and 1 deletions

30
cmd/migrations/main.go Normal file
View File

@@ -0,0 +1,30 @@
package main
import (
"cybertron/configs"
mig "cybertron/db"
"cybertron/pkg/log"
"github.com/spf13/cobra"
"go.uber.org/zap"
)
func main() {
configs.LoadMigConfig()
command := &cobra.Command{
Use: "migrations",
Short: "migrations",
Long: "running DB migrations",
RunE: func(cmd *cobra.Command, args []string) error {
err := mig.RunDatabaseMigrations()
if err != nil {
log.Fatal("cybertron migrations failed", zap.Error(err))
}
return nil
},
}
if err := command.Execute(); err != nil {
log.Fatal("cybertron migrations command execution failed", zap.Error(err))
}
}