-- Migration to create expense_concept_allocations table
CREATE TABLE `expense_concept_allocations` (
    `id` INT AUTO_INCREMENT PRIMARY KEY,
    `expense_id` INT NOT NULL,
    `concept_id` INT NOT NULL,
    `amount` DECIMAL(10, 2) NOT NULL,
    `created_at` DATETIME DEFAULT CURRENT_TIMESTAMP,
    FOREIGN KEY (`expense_id`) REFERENCES `expenses`(`id`) ON DELETE CASCADE,
    FOREIGN KEY (`concept_id`) REFERENCES `finance_collection_concepts`(`id`) ON DELETE CASCADE,
    UNIQUE KEY `unique_expense_concept_allocation` (`expense_id`, `concept_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
