Skip to content

What is the order in which scripts are executed? #462

Answered by erikbra
lamelyan asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, sorry if this is not clear in the documentation. Please feel free to submit a PR on the documentation if you have any suggestions to how you could get startet more easily.

It is mentioned, albeit only in passing, here: https://erikbra.github.io/grate/getting-started/#how-it-works

And, to make it evident: YES, the order of execution is alphabetical :)

Of course, your requirements may vary, but I usually number the scripts in the one-time folders, like this:

0001_create_schema_X.sql
0002_create_table_A.sql
0003_create_table_B.sql
0004_add_missing_column_Y_to_table_A.sql

etc. You might not have the need to grow above 999 files before you start using other characters, so a pattern of 001_…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@erikbra
Comment options

Answer selected by lamelyan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants