55
}
56
57
>
func validateSetupConfig(config *SetupConfig, db DB) error {
handler.go
58
>
if len(config.SchemaFilePath) == 0 && len(config.SchemaName) == 0 && config.DisableVersioning {
59
return NewConfigError("needs either " + flag(CLIOptSchemaFile) + " or " + flag(CLIOptSchemaName))
60
}
61
>
if (config.DisableVersioning && len(config.InitialVersion) > 0) ||
handler.go
62
>
(!config.DisableVersioning && len(config.InitialVersion) == 0) {
63
return NewConfigError("missing argument; either " + flag(CLIOptDisableVersioning) + " or " +
64
flag(CLIOptVersion) + " but not both must be specified")
65
}
66
>
if len(config.SchemaFilePath) > 0 && len(config.SchemaName) > 0 {
handler.go
67
return NewConfigError("either" + flag(CLIOptSchemaFile) + " or " +
68
flag(CLIOptSchemaName) + " must be specified")
69
}
71
if !slices.Contains(dbschemas.PathsByDB(db.Type()), config.SchemaName) {
72
return NewConfigError(fmt.Sprintf("%s must be one of: %v",