Skip to content

Instantly share code, notes, and snippets.

@zeeshangulzar
Created August 20, 2020 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeeshangulzar/b49e04112e98b5818bd0e3e394376bc2 to your computer and use it in GitHub Desktop.
Save zeeshangulzar/b49e04112e98b5818bd0e3e394376bc2 to your computer and use it in GitHub Desktop.
test
Mysql2::Error: Cannot add or update a child row: a foreign key constraint fails (`yamltranslator_backup`.`#sql-5bb_180`, CONSTRAINT `document_tokens_ibfk_10` FOREIGN KEY (`header_id`) REFERENCES `document_tokens` (`id`) ON DELETE SET NULL): ALTER TABLE `document_tokens` ADD CONSTRAINT `document_tokens_ibfk_10` FOREIGN KEY (`header_id`) REFERENCES `document_tokens` (`ID`)ON DELETE SET NULL;
/www/projects/omni/yamltranslator/db/migrate/20200820125748_update_document_token_footer_and_header_foreign_keys.rb:5:in `change'
/Users/xeeshan/.rbenv/versions/2.7.0/bin/bundle:23:in `load'
/Users/xeeshan/.rbenv/versions/2.7.0/bin/bundle:23:in `<main>'
Caused by:
ActiveRecord::InvalidForeignKey: Mysql2::Error: Cannot add or update a child row: a foreign key constraint fails (`yamltranslator_backup`.`#sql-5bb_180`, CONSTRAINT `document_tokens_ibfk_10` FOREIGN KEY (`header_id`) REFERENCES `document_tokens` (`id`) ON DELETE SET NULL): ALTER TABLE `document_tokens` ADD CONSTRAINT `document_tokens_ibfk_10` FOREIGN KEY (`header_id`) REFERENCES `document_tokens` (`ID`)ON DELETE SET NULL;
/www/projects/omni/yamltranslator/db/migrate/20200820125748_update_document_token_footer_and_header_foreign_keys.rb:5:in `change'
/Users/xeeshan/.rbenv/versions/2.7.0/bin/bundle:23:in `load'
/Users/xeeshan/.rbenv/versions/2.7.0/bin/bundle:23:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment