-
Notifications
You must be signed in to change notification settings - Fork 1.5k
migrate create with seq does not handle dot dir prefix #238
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
Comments
Thanks for reporting the issue! My guess is that |
This should be fixed in master now and will go out with the next release |
Unfortunately the fix seems to not be compatible with Windows paths.
|
Unfortunately, I don't have access to a windows machine, so won't be able to reproduce or fix the issue for windows. My guess is that the glob match needs to be cleaned before Does using windows path separators work? $ migrate create -seq -dir .\\backend\\migrations -ext sql create_accounts_table
$ migrate create -seq -dir .\\backend\\migrations -ext sql create_bots_table |
Nope, it doesn't work (with and without escaping backslashes):
I'll take a look and see if I can get it to work with Windows paths. |
* Validates migration version on creation, to avoid creation of duplicated versions * Uses `os.OpenFile` with `O_CREATE|O_EXCL` to create files to avoid file collisions * Uses `filepath.Join` to concatenate paths, making `cleanPath()` not necessary * Prints generated filenames * Fixes golang-migrate#238 * Supersedes golang-migrate#250
Uh oh!
There was an error while loading. Please reload this page.
Describe the Bug
When using the
create
subcommand with theseq
flag, the command fails ifdir
begins with a.
.Steps to Reproduce
Steps to reproduce the behavior:
mkdir test migrate create -ext sql -dir ./test -seq first
Expected Behavior
migrate create -seq
should create a second migration with the proper sequence number whendir
begins with a.
.Migrate Version
v4.4.0
Loaded Source Drivers
Loaded Database Drivers
Go Version
Stacktrace
Pretty sure it's this line: https://github.com/golang-migrate/migrate/blob/master/internal/cli/commands.go#L31
Additional context
migrate create -seq
works just fine whendir
does not begin with.
.The text was updated successfully, but these errors were encountered: