
use salarymarket ;

CREATE TABLE company_reports (
id INT AUTO_INCREMENT PRIMARY KEY,
label VARCHAR(255) NOT NULL,
date DATETIME NULL,
description TEXT,
fileId INT NULL,
companyId INT NOT NULL,
createdAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updatedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (companyId) REFERENCES company(id) ON DELETE CASCADE ON UPDATE CASCADE
);

-- Alter company_files table
ALTER TABLE company_files
ADD COLUMN reportId INT NULL;