CREATE TABLE IF NOT EXISTS `projectFinanceMonthly` (
    `id` INT AUTO_INCREMENT PRIMARY KEY,
    `projectId` INT NOT NULL,
    `metricName` VARCHAR(255) NOT NULL,
    `month` DATE NOT NULL,
    `amount` DECIMAL(15, 2) NOT NULL,
    `createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    `updatedAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    FOREIGN KEY (`projectId`) REFERENCES `projects`(`id`) ON DELETE CASCADE,
    UNIQUE KEY `project_metric_month` (`projectId`, `metricName`, `month`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
