View foreign keys:
show table status from db_name_here like 'table_name_here';
Create a foreign key:
ALTER TABLE `db_name_here`.`table_name_here` ADD CONSTRAINT `fk_foreign_key_name` FOREIGN KEY `fk_foreign_key_name` (`key_id`) REFERENCES `foreign_table` (`id`);
No comments:
Post a Comment