Switch to MySql
Posted: Tue Sep 27, 2016 11:26 pm
Hi,
i've finally moved my backend on MySql and even if everything in the beginning seemed fine i'm now encountering strange behaviuors with the relationships.
I don't fully undestand what's going on but i'm experiencing both, sometimes it doesn't take in consideration at all such relationships in insert (but normally loads everithing in fetch and 'apparently' works in update) and while saving an already existing object i obtain this error (after a bounce of successful ops on the same table):
"Column 'live_program_id' specified twice QMYSQL: Unable to execute query"
This is the attempted query:
INSERT INTO SubscriptionPlanItem (subscription_plan_id, live_program_id, subscription_plan_id, live_program_id) VALUES (:subscription_plan_id, :live_program_id, :subscription_plan_id, :live_program_id)
QMYSQL: Unable to execute query
This is a simple ManyMany extra table (2 cols in PK both involved in FK) but after having spent some hours in debugging it's now currently threated as a regular OneToMany/ManyToOne in the four cases. Even if i suppressed the many to many relationships hypothesizing a potential overlap causing the wrong query the behaviour isn't changed.
As a final note is funny that the entire application was perfecly working with SqLite3. Changing backend has broken something i guess.
Thanks a lot
i've finally moved my backend on MySql and even if everything in the beginning seemed fine i'm now encountering strange behaviuors with the relationships.
I don't fully undestand what's going on but i'm experiencing both, sometimes it doesn't take in consideration at all such relationships in insert (but normally loads everithing in fetch and 'apparently' works in update) and while saving an already existing object i obtain this error (after a bounce of successful ops on the same table):
"Column 'live_program_id' specified twice QMYSQL: Unable to execute query"
This is the attempted query:
INSERT INTO SubscriptionPlanItem (subscription_plan_id, live_program_id, subscription_plan_id, live_program_id) VALUES (:subscription_plan_id, :live_program_id, :subscription_plan_id, :live_program_id)
QMYSQL: Unable to execute query
This is a simple ManyMany extra table (2 cols in PK both involved in FK) but after having spent some hours in debugging it's now currently threated as a regular OneToMany/ManyToOne in the four cases. Even if i suppressed the many to many relationships hypothesizing a potential overlap causing the wrong query the behaviour isn't changed.
As a final note is funny that the entire application was perfecly working with SqLite3. Changing backend has broken something i guess.
Thanks a lot