INNER CODE UNIT · Go

main

datastax-archive/kaskada · wren/db/main.go:35

func main() {
	flag.Usage = func() {
		_, _ = fmt.Fprintf(flag.CommandLine.Output(), "generates db migrations from the ent schema")
		flag.PrintDefaults()
	}

	if err := envflag.Parse(); err != nil {
		log.Fatalf("failed to parse flags: %v", err)
	}

	// We need a name for the new migration file.
	if *name == "" {
		log.Fatalln("no name given. run with 'make' like this: 'NAME=the_name make ent/create-migrations'")
	}

	// Get the local migrations directory.
	dir, err := sqltool.NewGolangMigrateDir("wren/db/migrations")
	if err != nil {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…