Skip to content

Instantly share code, notes, and snippets.

@Gustavo-Kuze
Created October 27, 2019 10:18
Show Gist options
  • Save Gustavo-Kuze/da305b3e3f2f7f11f9cd2402d124cde8 to your computer and use it in GitHub Desktop.
Save Gustavo-Kuze/da305b3e3f2f7f11f9cd2402d124cde8 to your computer and use it in GitHub Desktop.
ERRO: Cannot change column 'id': used in a foreign key constraint '
Quando o erro "Cannot change column 'id': used in a foreign key constraint '"
acontecer ao tentar atualizar um id que é referenciado por uma FK é possível desativar
a verificação das FKs com a flag abaixo
SET FOREIGN_KEY_CHECKS = 0;
/* Faça o que quiser aqui */
SET FOREIGN_KEY_CHECKS = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment