You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATETABLEIF NOT EXISTS users (
id INTEGERNOT NULL AUTO_INCREMENT,
PRIMARY KEY (id)
);
CREATETABLEIF NOT EXISTS foo (
user_id INTEGERNOT NULL,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);
DROPTABLE users;
ERROR 3730 (HY000): Cannot drop table 'users' referenced by a foreign key constraint 'foo_ibfk_1' on table 'foo'.
Error: UNKNOWN_CODE_PLEASE_REPORT: Cannot drop table 'a' referenced by a foreign key constraint 'b_ibfk_1' on table 'b'.
> at Query.Sequence._packetToError (...node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
> at Query.ErrorPacket (...node_modules/mysql/lib/protocol/sequences/Query.js:79:18)
> at Protocol._parsePacket (...node_modules/mysql/lib/protocol/Protocol.js:291:23)
> at Parser._parsePacket (...node_modules/mysql/lib/protocol/Parser.js:433:10)
> at Parser.write (...node_modules/mysql/lib/protocol/Parser.js:43:10)
> at Protocol.write (...node_modules/mysql/lib/protocol/Protocol.js:38:16)
> at Socket.<anonymous> (...node_modules/mysql/lib/Connection.js:88:28)
> at Socket.<anonymous> (...node_modules/mysql/lib/Connection.js:526:10)
> at Socket.emit (events.js:315:20)
> at addChunk (_stream_readable.js:295:12)
The text was updated successfully, but these errors were encountered:
MySQL server version 8
mysqljs 2.18.1
ERROR 3730 (HY000): Cannot drop table 'users' referenced by a foreign key constraint 'foo_ibfk_1' on table 'foo'.
The text was updated successfully, but these errors were encountered: