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

RH on linux running up scripts in "reverse" order. #386

Closed
domingoladron opened this issue Sep 26, 2019 · 1 comment
Closed

RH on linux running up scripts in "reverse" order. #386

domingoladron opened this issue Sep 26, 2019 · 1 comment
Milestone

Comments

@domingoladron
Copy link

domingoladron commented Sep 26, 2019

This one took a while for me to work out, and I hope someone can help with how best to get around it.

So we have a folder structure for our up scripts:

- up
  - 0000_FirstScripts
    - 0001-Script1.sql
    - 0002-Script2.sql
  - 0001_SecondScripts
    - 0001-Script3.sql
    - 0002-Script4.sql
 - 0002_ThirdScripts
    - 0001-Script5.sql
    - 0002-Script6.sql

etc.

Now, when running this via the RH dotnet tool on windows, scripts are run in the expected order, top to bottom, from 0000 directory on downwards.

When running the same using the RH dotnet tool on linux, the order of the scripts run appears to be reversed, that is, starting with the LAST folder, 0002-ThirdScripts, then running the scripts inside that folder in top to bottom order, e.g. 0001-Script5.sql, 0002-Script6.sql, then back to 0001-SecondScripts, etc.

Now , our naming convention might be a bad one, so what naming standards are recommended to ensure things are run in the right order. In reading the source code, I see it is reading the filename from a path only, without the folder. Would we need to name scripts as all numbered away from one another, irrespective of subdirectory?

Let me know

@JscNZ
Copy link
Contributor

JscNZ commented Oct 17, 2019

Should be resolved once #393 is released 👍

@erikbra erikbra added this to the 1.2.1 milestone Oct 17, 2019
@erikbra erikbra closed this as completed Oct 17, 2019
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

No branches or pull requests

3 participants