-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
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
Running atlas commands against cockroachdb returns error with postgres wire protocol #3031
Comments
@a8m from the discord discussion regarding triggers in cockroachdb https://discord.com/channels/930720389120794674/933360123357839360/1270638827454730373 |
Was digging around the // Snapshot implements migrate.Snapshoter.
func (d *Driver) Snapshot(ctx context.Context) (migrate.RestoreFunc, error) {
// Postgres will only then be considered bound to a schema if the `search_path` was given.
// In all other cases, the connection is considered bound to the realm.
if d.schema != "" {
s, err := d.InspectSchema(ctx, d.schema, nil)
if err != nil {
return nil, err
}
if len(s.Tables) > 0 {
return nil, &migrate.NotCleanError{
State: schema.NewRealm(s),
Reason: fmt.Sprintf("found table %q in connected schema", s.Tables[0].Name),
}
}
return d.SchemaRestoreFunc(s), nil
} Which led me to test logging out of the atlas cli and running the command. Running it while logged out of atlas cloud, the command will run successfully (or in my case give another error because I'm trying to create migrations with multiple My guess is that the query being ran against cockroachdb are trying to execute a Postgres function that hasn't been ported over to cockroach. Running the commands while logged in, but against earlier versions of cockroach would error out with |
Running the commands
atlas migrate
oratlas schema
when trying to create either declarative or versioned migration workflows will result in an error:Error: sql/migrate: taking database snapshot: query triggers: pq: unknown function: regexp_match()
Steps to reproduce:
schemas.sql
:atlas schema
oratlas migrate
The text was updated successfully, but these errors were encountered: