yii2-usuario
yii2-usuario copied to clipboard
FK has no action for ON UPDATE
What steps will reproduce the problem?
I can't change id of user becouse FK is no action for ON UPDATE
What a reason for this behavior?
for profile, social_account, token
What is the expected result?
ALTER TABLE profile DROP FOREIGN KEY fk_profile_user;
ALTER TABLE profile
ADD CONSTRAINT fk_profile_user
FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE ON UPDATE CASCADE;
What do you get instead?
FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE;
https://github.com/2amigos/yii2-usuario/blob/c0afdd55c948f0aac1c8ef06e2136003485e9585/src/User/Migration/m000000_000002_create_profile_table.php#L39-L41
docs https://github.com/yiisoft/yii2/blob/558cd482d8a0525fceec8646ea20ccc9b7c3fdf4/framework/db/Migration.php#L453-L464
Some people do want RESTRICT vs CASCADE as modifying the ID of the user is not very common. How can we implement both worlds?
Some people do want RESTRICT vs CASCADE as modifying the ID
In module's internal logic? We must put both of model in synchronized state