We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version: "github.com/go-pg/migrations/v7" Running against cockroachdb, which should support IF EXISTS.
"github.com/go-pg/migrations/v7"
IF EXISTS
Error:
ERROR #0A000 unimplemented at or near \"if\""
Code:
func MigrateDatabase(db *pg.DB, schemaName string) error { // set the metadata table name migrations.SetTableName(fmt.Sprintf("%s.%s", schemaName, migrationsTableName)) // discover the local migration files if err := migrations.DefaultCollection.DiscoverSQLMigrations(migrationsPath); err != nil { return errors.New(fmt.Sprintf("could not discover migrations: %v", err)) } // try intializing the migrations meta table and migrating log.Debug("initializing migrations database") _, _, err := migrations.Run(db, "init") if err != nil { log.Warnf("could not init migrations: %v", err) } log.Debugf("migrating database") oldVersion, newVersion, err := migrations.Run(db, "up") if err != nil { return errors.New(fmt.Sprintf("could not migrate: %v", err)) } log.Debugf("upgraded db from version %d to version %d", oldVersion, newVersion) return nil }
The text was updated successfully, but these errors were encountered:
Caused by cockroachdb/cockroach#26443
Sorry, something went wrong.
No branches or pull requests
Version:
"github.com/go-pg/migrations/v7"
Running against cockroachdb, which should support
IF EXISTS
.Error:
Code:
The text was updated successfully, but these errors were encountered: