mongo-migrate-ts icon indicating copy to clipboard operation
mongo-migrate-ts copied to clipboard

feat: support glob

Open JustroX opened this issue 1 year ago • 8 comments

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!

JustroX avatar Jul 20 '23 22:07 JustroX

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

mycodeself avatar Aug 04 '23 17:08 mycodeself

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 avatar Aug 12 '23 15:08 JustroX

Implemented. Let me know what you think :)

JustroX avatar Aug 12 '23 18:08 JustroX

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

GerardSopsop avatar Aug 27 '23 08:08 GerardSopsop

I'll take a look thanks

JustroX avatar Sep 02 '23 08:09 JustroX

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.

mycodeself avatar Sep 15 '23 18:09 mycodeself

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 avatar Sep 15 '23 19:09 JustroX

@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.

JustroX avatar Sep 16 '23 06:09 JustroX

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

mycodeself avatar May 16 '24 20:05 mycodeself