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

Escape SQL query in Migration #245

Merged
merged 1 commit into from
Nov 29, 2022

Conversation

ctangney-tulip
Copy link
Contributor

Related unit(s) of work: #228

@ctangney-tulip
Copy link
Contributor Author

@sebastian-lenz

@sebastian-lenz sebastian-lenz merged commit 0acd4d0 into sebastian-lenz:master Nov 29, 2022
@sebastian-lenz
Copy link
Owner

Thanks a lot!

@sebastian-lenz
Copy link
Owner

The release 2.1.5 containing the fix has been published.

@zewVf9g3fsBigS8
Copy link

zewVf9g3fsBigS8 commented Sep 18, 2024

Hello Support Team
we are getting this issue blow mention detail

Craft CMS version: 4
PHP version: 8.1.29
I have attached a screenshot to getting this error.
Could you please assist in resolving this issue?
Uploading Screenshot from 2024-09-18 11-14-32.png…

Showing this issue why
Integrity constraint violation – yii\db\IntegrityException
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (adjoin_stage.changedfields, CONSTRAINT changedfields_ibfk_2 FOREIGN KEY (elementId) REFERENCES elements (id) ON DELETE CASCADE ON UPDATE CASCADE)
The SQL being executed was: INSERT INTO changedfields (elementId, siteId, fieldId, dateUpdated, propagated, userId) VALUES (45935, 1, 195, '2024-09-18 09:22:47', 0, 30571) ON DUPLICATE KEY UPDATE elementId=45935, siteId=1, fieldId=195, dateUpdated='2024-09-18 09:22:47', propagated=0, userId=30571
Error Info: Array
(
[0] => 23000
[1] => 1452
[2] => Cannot add or update a child row: a foreign key constraint fails (adjoin_stage.changedfields, CONSTRAINT changedfields_ibfk_2 FOREIGN KEY (elementId) REFERENCES elements (id) ON DELETE CASCADE ON UPDATE CASCADE)
)

Caused by: PDOException
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (adjoin_stage.changedfields, CONSTRAINT changedfields_ibfk_2 FOREIGN KEY (elementId) REFERENCES elements (id) ON DELETE CASCADE ON UPDATE CASCADE)
in /home/forge/adjoin.org/vendor/yiisoft/yii2/db/Command.php at line 1302

@ctangney-tulip ctangney-tulip deleted the issue-228 branch September 18, 2024 13:06
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

Successfully merging this pull request may close these issues.

3 participants