-- Pack 19
-- For existing installs with old MySQL, use the migration page:
-- /gopools/public/settings/project_equipment_migrate.php

CREATE TABLE IF NOT EXISTS project_equipment (
    id INT UNSIGNED NOT NULL AUTO_INCREMENT,
    project_id INT UNSIGNED NOT NULL,
    item_name VARCHAR(255) NOT NULL,
    category VARCHAR(120) NULL,
    quantity DECIMAL(12,2) NOT NULL DEFAULT 1.00,
    unit_cost DECIMAL(12,2) NULL,
    line_total DECIMAL(12,2) NULL,
    sale_price DECIMAL(12,2) NULL,
    notes TEXT NULL,
    created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (id),
    KEY idx_project_equipment_project (project_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
