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

schema_migrations table only ever contains a single record for MySQL driver, docker image #405

Closed
NickOttrando opened this issue Jun 19, 2020 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@NickOttrando
Copy link

NickOttrando commented Jun 19, 2020

Describe the Bug
The schema migrations table should contain a record for each migration ran, but it only ever contains a single record with the most recent migration version with MySQL.

Steps to Reproduce
Steps to reproduce the behavior:
Create two migration files, first 1_test.up.sql, run it with the migrate CLI command. Check the schema_migrations table, it will have a record for version=1. Create a second migration, 2_test.up.sql, run it with the same CLI command (e.g. migrate ... up 1), select * from schema_migrations and the record for version=1 is no longer there, only version=2. Docker image may or may not be a factor in reproducing.

Expected Behavior
I expect to see all migrations that have ran in the schema_migrations table, not just the most recent.

Migrate Version
v4.11.0 (docker image)

Loaded Source Drivers
docker image

Loaded Database Drivers
mysql

Go Version
go1.13 linux/amd64

@dautushenka
Copy link

Looks like it's default behavior. We have the same issue with postgresql. It's relay not convenient with team 2 and more people. Looking for another tool for now(

@NickOttrando
Copy link
Author

NickOttrando commented Jun 19, 2020

Looks like it's default behavior. We have the same issue with postgresql. It's relay not convenient with team 2 and more people. Looking for another tool for now(

I thought this was a bug given that no other migration tools that I've used behave like this, and there is no documentation whatsoever on the behavior of the schema_migrations table that I could find.

@dhui
Copy link
Member

dhui commented Jun 19, 2020

See also: #179

@dhui dhui added the duplicate This issue or pull request already exists label Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants