-
Notifications
You must be signed in to change notification settings - Fork 7
Add absolute path to Spiral/Database/Injection/Fragment in alterColumn function #8
Comments
I found monkey patching solution for this particular usecase, spiral/reactor/src/Serializer#117-119 need to be rewrite as
|
Or just add __set_state function to Spiral/Database/Injection/Fragment class |
Thank you for the report. Will be fixed today. |
Please check the v2.7.1 version of |
This problem is still in project. So I think, that Reactor need to change a little bit. |
I would greatly appreciate your PR to Reactor. If not I’ll check next week. |
At least it would be great to have a failing test |
Here example of failing entities. https://github.com/mrakolice/migrations/tree/error-with-spiral-reactor my composer.lock: cycle/orm v1.1.18 |
If I try to do
in spiral/reactor/Serializer.php, then function BaseTest->assertSameAsInDb start working unexpectedly But in database I can see changes (column type change from |
@wolfy-j I assume that the second error in tests is related directly to the migrations package |
The reactor has been fixed in the v2.2.3 release |
Thanks! I am waiting for migrations package fix. |
@mrakolice I've added your breaking input as a PR to the |
By the way, what is the purpose of changing PK column type? Also, I assume that the correct alter change should contain also |
@vvval yeah, you absolutely right about I think, this problem will be exist when altering fields with other sequences, rather than PK, but I don't testing it. |
Val, can you check the default value of that column and see what needs to be written into Column in order to keep the type persistent. |
Would readonly schema help in this case? |
@mrakolice see above please |
What should I do? Make database schema (in rdbms) readonly or what? |
Check readonlySchema annotation, it won’t generate migration for your table: https://cycle-orm.dev/docs/annotated-entity |
This is not my solution, unfortunately. |
Without leading slash composer try to find this class in Migration namespace instead of global.
The text was updated successfully, but these errors were encountered: