daniellima0 / corretores-online

3 stars 0 forks source link

Automate database scripts when running the backend #38

Closed BernardoSResende closed 3 months ago

BernardoSResende commented 4 months ago

Whenever the backend runs, the migrations that have not been applied should be. you should also check for the best way to implement this. Suggestion: delete the entire database and build it again everytime the backend runs using the migrations. This also enables us to create better seed scripts so that we always have a populated database for whenever we use it. Initially, this seeds part is not mandatory, it can be a future issue, but if you find this solution useful and have time to implement it as well, it would be great

If there is a command you need to run in the database before the other migrations, you can name it 0000000000_initialconfig.sql or something like that, so it is always the first one