Closed benjie closed 10 months ago
easier to view history in git no need to come up with a numeric prefix for it - can just reorder as text
These are really beneficial, any plans for adding them?
Yep, have filed #163 to track the idea for when I (or someone else) have time to implement it.
I was just looking for a way to pull this off, this is exciting :)
@benjie quick question... when do you plan on pushing the next release.... I may be asking selfishly :)
This is already available as graphile-migrate@next:
https://www.npmjs.com/package/graphile-migrate?activeTab=versions
Feature description
We already have
--! no-transaction
special comment, and we have:PLACEHOLDER
replacement... This feature would replace a--! include funcs/my_func.sql
comment with the contents of thefuncs/my_func.sql
file from themigrations/
folder. This is akin to symlinking the file into thecurrent/
directory, but with the following advantages:current.sql
in addition tocurrent/
folderOn commit a snapshot of the file will be included into the
migrations/committed/
entry (and this is the code that would run ongraphile-migrate migrate
, rather than performing the--! include
at that time).Motivating example
Iterating functions, policies, and other stateless resources can be annoying - having to copy the definitions out from a previous migration or from a DB dump and then edit them. Also tracking history of them is a pain. Easier to edit them in one place (like regular code) and then "pull" them into the migration for execution.
Breaking changes
None.