Skip to content
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

Atlas migrate apply fails against CockroachDB 24.3 #3357

Open
joelhess opened this issue Jan 31, 2025 · 2 comments
Open

Atlas migrate apply fails against CockroachDB 24.3 #3357

joelhess opened this issue Jan 31, 2025 · 2 comments

Comments

@joelhess
Copy link

When attempting to run a set of migrations against an existing database, I get the following error: Error: sql/schema: modify "atlas_schema_revisions" table: pq: at or near "access": syntax error

It fails when there is an existing atlas_schema_revision table only. If I delete the table and re-run, it will regenerate it, though the schema it creates is the same as the old one. Running the update again against the newly created version also fails.

This command worked in version 0.26 of the CLI.

Here's the command that I'm using:
atlas migrate apply --url "postgres://$FW_CRDB_USER:$FW_CRDB_PASSWORD@$FW_CRDB_HOST:$FW_CRDB_PORT/exchange_sitemanager" --dir file://ent/migrate/migrations --allow-dirty --revisions-schema public --dry-run

using:

atlas version
atlas version v0.30.1-614b10f-canary
https://github.com/ariga/atlas/releases/latest

on MacOS, though the same error occurs when deployed via docker/kube

My database logs don't show me anything useful at this point so I'm a little stuck on how to troubleshoot.

@matthewhunter404
Copy link

I also experienced the same issue. Temporary workaround is to reinstall and specify the previous version:

curl -sSf https://atlasgo.sh/ | ATLAS_VERSION=v0.29.0 sh

@joelhess
Copy link
Author

joelhess commented Feb 6, 2025

Thanks for the tip. Unfortunately v0.29 has a couple of security vulnerabilities that were the reason we were trying to upgrade it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants