graphile / migrate

Opinionated SQL-powered productive roll-forward migration tool for PostgreSQL.
MIT License
751 stars 58 forks source link

Watching additional sql files (referenced in afterCurrent) #209

Open janm6k opened 9 months ago

janm6k commented 9 months ago

Summary

In the project I work on, we have a "seed.sql" included in afterCurrent field of the .gmrc config file.

The seed.sql contains testing data that I need to edit from time to time. When I edit it, and I have graphile-migrate watch running, it would be very handy if the current migration run again (like if the current migration was edited), and the seed data updated in database. My workaround is to actually edit the current migration by adding "select 1" there and then removing it :)

Is there a way to specify that watch command should also watch some additional files?

If there isn't a way, would it be a good opportunity for me to try to add it and submit PR?

benjie commented 8 months ago

No, we don't have that; yes, this would be a good opportunity to make that change.

Ideally it would work like magic, which we could accomplish by determining the SQL files that the gmrc references and automatically monitoring those.

Failing that, adding a "watchFiles: [...]" list to the config with paths to the relevant files to watch in addition would also be effective.