-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Migration Logic #2137
New Migration Logic #2137
Conversation
@lonnieezell @jim-parry This might be a good one to expedite before people (like me!) start converting projects to the new migrations. |
Good catch. Thanks! |
Holy Redis test failure! I saw a recent Redis merge come through - perhaps related? Looks like migrations tests all passed though. |
One more change to fix #2139 - migrations harvested across all namespaces need to be sorted before calling |
Once again, all test failures were due to |
Well bollocks - I didn't know how to do an upstream recursive merge on the website so I did it locally but forgot this computer wasn't signed. I'll see if I can fix it, but it truly is me. ^^ |
c1febc9
to
4223467
Compare
Okay, redone with GPG. @lonnieezell think this one is all set - still need to look at the migration logic but hopefully this takes care of the bugs. |
I have a lot more coming - this has grown significantly, hoping to have the new version posted tonight. |
Looking forward to it. Thanks so much for tackling this one! |
@lonnieezell I still have to update the commands, tests, and docs but I changed the Runner so much I wanted to get it up for your review before I build around it. Changes started small and then kept growing and growing... See what you think, I'm open to anything. |
This is real close but I'm hitting a snag.
I'm leaning towards 2, but would like some guidance. @lonnieezell ? |
I'm fine with option 2. I guess ideally option 1 would be better, but might be trickier to manage. |
I tried to make option 1 work. Support migrations were moved to their own directory and namespace, "DatabaseTestMigrations/Database/Migrations", but now I need to back-burner this project for a bit but feel free to pick it up @lonnieezell, I've allowed "edits from maintainers". |
Looks like I'm not able to push my changes directly back into this repo. Good news is that I did get it figured out how to do it. I'm thinking MockServices isn't used anymore. Ended up using I've got 3 tests that are failing currently, but I'll have to get to those tomorrow. Close! |
That’s great news! I didn’t know that autoloader function existed, very handy. I haven’t used the “allow edits from maintainers” before, but let me see if I can add you to my fork... |
Okay I added you and @jim-parry to my fork in case you ever need to modify a PR. |
@lonnieezell I should be available to work on this again today or tomorrow. Do you have a solution already? or progress you'd like to share? Feel free to push anything to the fork, or I can take it up from here with your |
@MGatner I just pushed all of my changes up in to the migration-union branch. Can you pull that down and give it a spin. I think everything is working now. |
@lonnieezell This appears to be passing all tests and looks good to go - did you know of something else that had to happen? I've been using the new FYI the unsigned commit is your merge of my forked branch, 7fa8f02. |
@MGatner Didn't know of anything else that needed done, no. Wasn't sure if you had more you wanted to tackle on this or if you were done so I thought I'd give you a look. Also - just to make sure I didn't miss anything. :) I'll go ahead and merge then. Thanks! |
Then again - looking at the files that changed I still have some work to do. I refactored the |
Hmm oops I didn't notice that. Did you mean that you intentionally changed If you can outline what you see that is messed up I can take a crack at it. |
I meant to rename I didn't mind |
Ohhh okay yeah I saw all those changes, I thought that was from merging codeigniter4/develop and something had been changed elsewhere. I'll see what I can sort out... |
…into migration-union
… few tests. Close but not quite everything passing just yet.
8ac7eb8
to
3b0ad16
Compare
Alright that was the most git-fu I've ever done but I think I got all the good stuff cherry-picked and (assuming this still passes) it should be ready to merge. I didn't touch method names but I'm definitely not opposed to changes (like regress -> rollback). |
Ok - I think this works for now. Thanks for cleaning that up! I wouldn't mind changing the |
UPDATE: this has turned into a pretty comprehensive change to the logic and implementation behind migrations.
Description
With the migration refactor
findMigrations()
now returns migrations with their version as their index key.latestAll()
currently usesarray_merge()
to create one final array from all namespace migrations, butarray_merge()
renumbers numeric (i.e. integer, even as a technical string) keys so that the target version fails to locate incheckMigrations()
.This change uses the array union operator instead of
array_merge()
as it does no renumbering.Checklist: