CREATE TABLE `Chapters` ( `id` int PRIMARY KEY AUTO_INCREMENT, `number` int NOT NULL, `content` text NOT NULL, `note_id` int NOT NULL ); ALTER TABLE `Chapters` ADD FOREIGN KEY (`note_id`) REFERENCES `Notes` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; ALTER TABLE `Notes` DROP COLUMN `content`;