-- Content audit fields for Procedure (reusable pattern for other content tables later)
ALTER TABLE `Procedure` ADD COLUMN `createdById` VARCHAR(191) NULL,
    ADD COLUMN `updatedById` VARCHAR(191) NULL;

ALTER TABLE `Procedure` ADD CONSTRAINT `Procedure_createdById_fkey` FOREIGN KEY (`createdById`) REFERENCES `User`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

ALTER TABLE `Procedure` ADD CONSTRAINT `Procedure_updatedById_fkey` FOREIGN KEY (`updatedById`) REFERENCES `User`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

CREATE INDEX `Procedure_createdAt_idx` ON `Procedure`(`createdAt`);
CREATE INDEX `Procedure_updatedAt_idx` ON `Procedure`(`updatedAt`);
CREATE INDEX `Procedure_createdById_idx` ON `Procedure`(`createdById`);
CREATE INDEX `Procedure_updatedById_idx` ON `Procedure`(`updatedById`);
