Closed turtle0x1 closed 1 year ago
Initial pass at a debug it looks like it creates the right SQL.
On cluster replication member it also doesn't create the constraints (FK,) but I think those silently fail due to miss matched table types (also scary, these errors should really bubble).
Okay this was premature.
If you run the migration with the engine set to innodb
instead of nbcluster
before updating the engine (without dropping the innodb
table from other cluster members) this library fails silently.
This is a real edge case caused by a blunder I should have recognised.
That being said, it would be nice if phinx could error in the mysql cluster context on this error (if it can, I assume mysql/PDO doesn't error ergo phinx doesn't).
Recently pivoted to using this library on an application that is based on a mysql cluster (5.7 if that matters, which It might).
The problem I'm facing is the server that runs the migration see's the new table engine as
ndbcluster
but the other servers seem to see it asInnoDB
(which doesn't work as expected in the cluster context).I didn't face this problem when running raw
.sql
migrations but very much would like to stick with library as it solves alot of problems.This issue may be premature, it may be my environment. Though what ever caused this, sure is a "surprise".
If the tables aren't all declared as
ndbcluster
, replication doesn't happen. If replication doesn't happen 50% of the time we respond with an empty result set (or far far worse).Example working
.sql
Example broken phinx migration & config
Config
Migration
My environment
Despite multiple warnings about not relying on defaults, this database default
engine
isn't set tondbcluster
(though I dont think that should matter in this context).