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

Validate migration encoding #2069

Closed
Ryanman opened this issue Jul 5, 2018 · 3 comments

Comments

@Ryanman
Copy link

commented Jul 5, 2018

V5.0.7, Free
Command Line Client
MSSQL 2012 Enterprise
Windows 10
What did you do?

I work with SQL developers who, somehow, manage to create and add a multitude of variously encoded .sql files. For many these do "Fail Fast" but in particular ANSI-encoded files will still execute... with botched characters. This is particularly dangerous.

What do you want to see?

I have loved flyway so far and hope this doesn't come across as entitled. I think an encoding check for the migrations folder would be a great idea especially for these corner cases that can seriously ruin a whole migration. For teams that have automated fully and can't manage to enforce encoding, this will help avoid problems.

Right now my workaround will be to write a powershell script that performs this as part of our Pull Request, Gated Commit process.

@axelfontaine axelfontaine changed the title Fail Migration (or make configurable?) when a migration file violates encoding parameter Validate migration encoding Jul 6, 2018

@axelfontaine axelfontaine added this to the Flyway 6.0.0 milestone Jul 6, 2018

@axelfontaine

This comment has been minimized.

Copy link
Member

commented Jul 6, 2018

Thanks for the suggestion. I can see how this could be useful as an additional safeguard as part of the validate step for example.

@axelfontaine

This comment has been minimized.

Copy link
Member

commented Jun 6, 2019

We have now addressed this at least partially. Flyway will now complain when it is configured for UTF-8 and being fed a windows-1252 file for example. However when bytes are valid in both encodings like for example UTF-8 and ISO-8859-1 it isn't able to reliably report this and I am honestly not sure it is possible to fix this.

axelfontaine pushed a commit to flyway/flywaydb.org that referenced this issue Jun 6, 2019
@Ryanman

This comment has been minimized.

Copy link
Author

commented Jun 6, 2019

Awesome, thanks for the work and the product!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.