Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update model with relation #131

Open
VnukA opened this issue Nov 12, 2017 · 1 comment
Open

Update model with relation #131

VnukA opened this issue Nov 12, 2017 · 1 comment

Comments

@VnukA
Copy link

VnukA commented Nov 12, 2017

Hi,
I,m updating model with hasMany relation.
mysql query update relation example (id is AIPK)
DELETE FROM bibliography WHERE (item_id=13) AND (id<>NULL)
INSERT INTO bibliography (name, item_id, lock, created_at, updated_at, created_by, updated_by) VALUES ('anywhat', 13, 0, NOW(), NOW(), 1, 1)
But operator delete don't work correctly
explain DELETE FROM bibliography WHERE (item_id=13) AND (id<>NULL)
"id" "select_type" "table" "type" "possible_keys" "key" "key_len" "ref" "rows" "Extra"
"1" "SIMPLE" \N \N \N \N \N \N \N "Impossible WHERE"
row don't delete and insert duplicate entry with new PK
How to fix it?
Tnx

@alvarolordelo
Copy link

@VnukA take a look at
#138

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants