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

sql-migrate status fails with "Could not create constraint or index" #211

Open
esetnik opened this issue Mar 1, 2022 · 5 comments
Open

Comments

@esetnik
Copy link

esetnik commented Mar 1, 2022

$ go get -v github.com/rubenv/sql-migrate/[email protected]
$ sql-migrate status -env="dev"
mssql: Could not create constraint or index. See previous errors.

How can I see previous errors as nothing else is output in the terminal. Also why is a constraint or index attempting to be created when running the status command?

@esetnik
Copy link
Author

esetnik commented Mar 1, 2022

Relates to #117

@esetnik
Copy link
Author

esetnik commented Mar 2, 2022

FYI this is only happening after upgrading to v1.1.0+. v1.0.0 is working fine.

$ go get -v github.com/rubenv/sql-migrate/[email protected]
$ sql-migrate status -env="dev"
Getting migration status
+-----------------------------------------------------------------------------------------------+-----------------------------------+
|                                           MIGRATION                                           |              APPLIED              |
+-----------------------------------------------------------------------------------------------+-----------------------------------+
...

@esetnik
Copy link
Author

esetnik commented Dec 19, 2023

I think this is being caused by go-gorp/gorp#450

@caioparazzi
Copy link

This happens on my stack as well, I have a mssql database set up on a docker container and I'm able to connect my application and create tables through raw queries, however, even after setting up an empty database and running sql-migrate status, I have the constraint error :/

@Pompedup
Copy link

Pompedup commented Apr 16, 2024

Hello, I reproduce the same issue.

I try with the last version of sql-migration and it gave me Migration failed: mssql: Could not create constraint or index. See previous errors.

After downgrading as suggested by @esetnik in 1.0.0, it worked.

My config:

development:
  dialect: mssql
  datasource: sqlserver://sa:password@localhost:1433
  dir: migrations
  table: migrations

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

3 participants