Pre-existing quotations.project_code + ai_chat_messages FK drift is captured in its own reconcile_quotations_aichat_fk migration; the issued_orders migration is purely additive. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
9 lines
375 B
SQL
9 lines
375 B
SQL
-- DropForeignKey
|
|
ALTER TABLE `ai_chat_messages` DROP FOREIGN KEY `fk_ai_chat_conv`;
|
|
|
|
-- AlterTable
|
|
ALTER TABLE `quotations` MODIFY `project_code` VARCHAR(100) NULL;
|
|
|
|
-- AddForeignKey
|
|
ALTER TABLE `ai_chat_messages` ADD CONSTRAINT `ai_chat_messages_conversation_id_fkey` FOREIGN KEY (`conversation_id`) REFERENCES `ai_conversations`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|