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

Fix file:// URLs on Windows #132

Merged
merged 1 commit into from
Jun 9, 2024
Merged

Conversation

NathanBaulch
Copy link
Contributor

@NathanBaulch NathanBaulch commented Jun 6, 2024

This simple PR fixes an "invalid port" url.Parse issue caused by back-slashes in file:// URLs on Windows.
I can confirm that my Terraform based migrations completed successfully when running this patched version.

@NathanBaulch
Copy link
Contributor Author

This is closely related to the issue mentioned in ariga/atlas#1528

@rotemtam rotemtam requested a review from giautm June 6, 2024 10:23
@@ -144,7 +145,7 @@ func (d *MigrationDataSource) Read(ctx context.Context, req datasource.ReadReque
return
}
r, err := d.client.MigrateStatus(ctx, &atlas.MigrateStatusParams{
ConfigURL: fmt.Sprintf("file://%s", cfgPath),
ConfigURL: fmt.Sprintf("file://%s", strings.ReplaceAll(cfgPath, `\`, "/")),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't, perfect! I shall update the PR...

@giautm giautm merged commit 9aaee34 into ariga:master Jun 9, 2024
11 of 17 checks passed
@giautm
Copy link
Member

giautm commented Jun 9, 2024

Hey @NathanBaulch, thank you for your contribution.

@NathanBaulch NathanBaulch deleted the windows-support branch August 11, 2024 05:48
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

Successfully merging this pull request may close these issues.

3 participants