00abbf1af5
* Added basic documentation wireframe for api, commands, and forms. * Added doc.go
26 lines
516 B
Go
26 lines
516 B
Go
package commands
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/photoprism/photoprism/internal/photoprism"
|
|
"github.com/urfave/cli"
|
|
)
|
|
|
|
var MigrateCommand = cli.Command{
|
|
Name: "migrate",
|
|
Usage: "Automatically migrates / initializes database",
|
|
Action: migrateAction,
|
|
}
|
|
|
|
// Automatically migrates / initializes database; called by MigrateCommand
|
|
func migrateAction(context *cli.Context) error {
|
|
conf := photoprism.NewConfig(context)
|
|
|
|
fmt.Println("Migrating database...")
|
|
|
|
conf.MigrateDb()
|
|
|
|
fmt.Println("Done.")
|
|
|
|
return nil
|
|
}
|