Migration shell for migration from core 'Translate' to 'ShadowTranslate' behaviour #26
Conversation
Please just poke with whatever should be changed 馃槃 |
poke poke @AD7six |
$this->hr(1); | ||
} | ||
} | ||
} catch (\Exception $e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nested try catch is a bit weird - what's the reason for that?
Looks like it works but I'm not so keen on using the App model classes to do the inserts/updates. It's going to be susceptible to validation problems, and it's updating the same records once per translated field that way - that's potentially very inefficient. I'd much rather aim for a solution ala:
The above sql is how I'd do it without a shell and is likely one or two orders of magnitude faster than the current shell. I'm flexible, but a solution needs to work in principle with any amount of data - not just trivial amounts, so
Are you game to make those changes? |
Mmh, I'm not sure if we "should" meet any validation in the models, but this could be fixed if I'd just change the language of the Table and then just I agree that it's about as inefficient/stupid as it can be, and that it could be optimised a lot in terms fo speed using a structure somewhat like what you wrote - but this is generic and works (as far as I can see 馃槢) for all cases with running just one single script - that's what I prioritised when doing it. Also I'm co owner of a small startup, and we're really busy atm trying to raise interest from investors - so there could be quite some time before I'd have time to get back to this. We already used this to migrate all our DB translations - although #25 does keep us from using ShadowTranslate in production yet 馃樋 How about having both solutions? |
I don't know what two solutions you mean..? Writing two implementations doesn't make sense to me.
I'm actually more interested/concerned with being sure it will complete on a more sizeable amount of data than merely optimizing it. I don't want to add a cli which immediately becomes a maintenance problem for me because "it doesn't work" with a realistic but large number of translation records.
Me too =) |
I mean both having a possibility to import all tables at once, and one at a time 馃槃
Yeah, I see your point - I have no clue about how many translations people have in their DB's I think I'll just let it stay for now, maybe someone else having the need for this feature will pick it up from here :-) At least they can use this solution for small solutions like ours (8k rows in i18n table) if they'd like to :) |
Closing for now, we can revisit in the future. Thanks for the effort anyway :) |
According to #24 and https://github.com/AD7six/cakephp-shadow-translate#roadmap 馃槃
TODO