5

I'm using DbUp, starting from the example I've created a C# program. The example suggest me to put all scripts under Scripts directory. Ok, this is done but, when script number will grow up that directory will be such a big mess.

I would organize that directories with version number. For instance

  • 1.0.0 (directory)
    • CS001 - baseline.sql
  • 1.0.1 (directory)
    • CS001 - alter x table.sql
    • CS002 - create y procedure.sql
  • 1.1.0 (directory)
    • CS001 - create view z.sql

Obviously, code would take the script in an ordered manner. How can I do that? Where I found documentation and other examples?

2 Answers 2

1

DbUp automatically takes the filenames in alphnumeric order, so prefix them with a version or timestamp.

3
1

DbUp takes the path into consideration and stores it in SchemaVersions. You organize exactly as you have asked the question.

1
  • This is the correct answer, although an example would be probably make it easier to understand Nov 21, 2018 at 2:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.