Allow editing of migration file in "Confirm migration" popup in database table editor.#282
Allow editing of migration file in "Confirm migration" popup in database table editor.#282bennothommo merged 8 commits intorainlab:masterfrom
Conversation
|
@Air-Petr Excellent work! This works really well - well done! Just a couple of minor issues I found during testing, hopefully they shouldn't take too long to sort out:
|
|
On the second point above, I wonder if it might be better to show 2 code editors, one for the "up" migration and one for the "down" migration, and only showing the code for the actual field/table changes to prevent people from being silly and messing about with the migration methods. Any thoughts on that? |
|
@bennothommo As long as we have proper error handling in place to handle people being silly I'd rather it was just one code editor to empower the developer to do whatever they need / want to do. Sometimes you might want to add other methods. As long as we can gracefully handle people being silly there's no need to restrict the flexibility of the tool. |
|
@bennothommo I'll try to solve these issues as soon as possible. Thanks for your review.
This is an interesting thought. But I agree with @LukeTowers: there could be some additional methods in the migration file. Though I can't imagine any situation where other methods are really needed 😅 It would be interesting to hear other opinions. |
|
Other methods would be purely for organizational purposes and mostly useful to do DB seeding, migrations by themselves are usually short enough to not need any other methods. |
|
@Air-Petr @LukeTowers My justification for the suggestion was simply that if they want to do some sort of complex migration, they can use the Versions area. I feel this popup migration editor (or editors) is more for adding adjustments to the migration that cannot be done through the database table editor, for example, to add indexes or comments. |
@bennothommo It's strange, but I can't reproduce this issue. I always got |
|
@Air-Petr Not sure what was happening for me before, but I am getting the same error as you now as well, so that's fine. I've tested your latest changes and everything is working as it should, so it's all good to merge. Thanks heaps for your contribution! :) |
It's about our conversation in i279.
The main things:
Throwableto handle errors in a migration code.