Skip to content

prefix migrations dir to URI #1899

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

Merged

Conversation

jtlisi
Copy link
Contributor

@jtlisi jtlisi commented Dec 10, 2019

What this PR does:

Ensures the proper file URI scheme for the provided migrations directory.

Which issue(s) this PR fixes:
Fixes #1802 (comment)

@jtlisi jtlisi force-pushed the 20191207_prefix_migrations_dir branch from b705ff1 to cd57ded Compare December 10, 2019 21:34
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
@jtlisi jtlisi force-pushed the 20191207_prefix_migrations_dir branch from cd57ded to e9e5fdf Compare December 10, 2019 21:38
i := strings.Index(migrationsDir, ":")

// Add file scheme if no scheme is present
if i < 1 {
Copy link
Contributor

Choose a reason for hiding this comment

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

!strings.Contains() is shorter

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 ended up using strings.HasPrefix

Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
@jtlisi jtlisi marked this pull request as ready for review December 13, 2019 21:29
@jtlisi jtlisi requested review from bboreham and gouthamve December 16, 2019 01:43
@bboreham bboreham merged commit bc32cfa into cortexproject:master Jan 7, 2020
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.

2 participants