1ALTER TABLE orders
2ADD
3FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
1ALTER TABLE `TABLE_NAME`
2ADD COLUMN `COLUMN_NAME` BIGINT(20) UNSIGNED NULL DEFAULT NULL AFTER `AFTER_COLUMN_NAME`,
3ADD FOREIGN KEY `FOREIGN_RELATION_NAME`(`COLUMN_NAME`) REFERENCES `FOREIGN_TABLE`(`FOREIGN_COLUMN`) ON UPDATE SET NULL ON DELETE SET NULL
1ALTER TABLE tryholpz_demo07.core_modules
2ADD COLUMN belongs_to_role INT,
3ADD FOREIGN KEY core_modules(belongs_to_role) REFERENCES role_specific_modules_info(id) ON DELETE CASCADE