mycodeself / mongo-migrate-ts

Run mongodb migrations easy from TypeScript
MIT License
87 stars 28 forks source link

feat: support glob #90

Closed JustroX closed 5 months ago

JustroX commented 1 year ago

This PR adds support for specifying custom extensions for migration scripts. This is somehow related to #72, as we have a similar use case, i.e. for testing migrations. However, I only implemented filtering by file extensions/file name suffixes instead of glob.

Also, if the file extension is specified in the config, the generated migration script's filename will also have that extension.

Your reviews and insights are highly appreciated. Thank you!

mycodeself commented 1 year ago

Hi Justrox,

thanks a lot for your contribution, seems some tests are failing... anyway I think using a glob pattern will be a better implementation for this, what do you think?

See the discussion #72

JustroX commented 1 year ago

Thanks. Apologies for the late response, been buried in my work. I agree that glob patterns are better, I just initially implemented file name suffixes as it's enough for my use case. I'm still up for coding glob patterns tho :) I'll try tonight

JustroX commented 1 year ago

Implemented. Let me know what you think :)

GerardSopsop commented 1 year ago

Hello, my current team uses MongoDB and we badly need this feature. Any updates on this? Thanks' a lot man, @mycodeself

JustroX commented 1 year ago

I'll take a look thanks

mycodeself commented 1 year ago

Hello @JustroX, I've opened a new PR including support for glob #95 but I'd like your contribution to be taken into account, so I leave you a few days in case you want to see my proposal and apply the suggested changes.

JustroX commented 1 year ago

Sorry for the delay, work has been keeping me busy. I haven't had a chance to start on it yet, so please feel free to proceed with the pull request.

Great work :) Thanks a bunch!

On Sat, 16 Sep 2023, 02:30 mycodeself, @.***> wrote:

Hello @JustroX https://github.com/JustroX, I've opened a new PR including support for glob #95 https://github.com/mycodeself/mongo-migrate-ts/pull/95 but I'd like your contribution to be taken into account, so I leave you a few days in case you want to see my proposal and apply the suggested changes.

— Reply to this email directly, view it on GitHub https://github.com/mycodeself/mongo-migrate-ts/pull/90#issuecomment-1721683559, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFLJG3F23J524WL2TND6KDTX2SNGHANCNFSM6AAAAAA2SB4H3Q . You are receiving this because you were mentioned.Message ID: @.***>

JustroX commented 1 year ago

@mycodeself If ever, may I ask what changes are needed for the down and new commands? For the down command, I think the file reference was saved in the database. For the new command, I don't think we can unambiguously know where should the file be placed solely from the glob pattern.

mycodeself commented 5 months ago

Hey, sorry for the delay I was really busy, but I implemented the changes needed to have this working. Thanks for your contribution.