Simplify logic paths in two functions

Merged
#37 · Created  · Last updated

Description

This commit replaces the custom implementation of the sort.Reverse function with golang's built in sort.Reverse function to reverse the order of the migration scripts (descending sort). In the EnsureDbVersion function it simplifies logic paths by reducing the number of conditions checked before a new version is added to the "to skip" slice. In function splitSQLStatements it changes the order of the conditions checked because 1) It is not possible for statementEnded to be true and ignoreSemicolons to be true at the same time because those variables are set together in the same block and 2) ignoreSemicolons belongs together with endsWithSemicolon line. Also renamed script variable to scriptFile variable to indicate scriptFile is a path, not a script in a string variable.

0 attachments

0 comments

Loading commits...