Closed gemscng closed 5 years ago
Any particular reason why you'd want to put migrations in subfolders?
@rubenv
- I have another use case, which we need to separate Foreign key migration from other migration. Foreign key migration will not be run in the testing docker, to allow simpler db testing code.
That sounds like a very bad idea, always keep your testing as similar to production as possible. But I'm sure you have good reasons for that.
If you don't mind, I'd rather not add this: subfolders isn't something I'd like to recommend (things get confusing quickly, as different operating systems use different sorting methods for subfolders / normal files).
MigrationSource
is an interface, so just drop a copy of your FileMigrationSource
into your own project and use that, will work great and requires no changes to sql-migrate
.
@rubenv No problem.
@rubenv
If you don't mind, I'd rather not add this: subfolders isn't something I'd like to recommend (things get confusing quickly, as different operating systems use different sorting methods for subfolders / normal files).
Just to be clear, the algorithm of my code just grab the file from the subfolder and see if there are folder to skip. The ordering of the migration is still depends on the file name of .sql. So this should not be a concern in different OS? Still subfolder can be a help when your system has more and more migration in the future.
Support subfolder so that we are allowed to organize the migration in folders