USE osman;
CREATE TABLE IF NOT EXISTS equipment_parts_link (
  id INT AUTO_INCREMENT PRIMARY KEY,
  equipment_id INT NOT NULL,
  part_id INT NOT NULL,
  quantidade_padrao DECIMAL(10,2) DEFAULT 1,
  observacao VARCHAR(255) DEFAULT NULL,
  FOREIGN KEY (equipment_id) REFERENCES equipments(id) ON DELETE CASCADE,
  FOREIGN KEY (part_id) REFERENCES parts(id) ON DELETE CASCADE,
  UNIQUE KEY uq_equip_part (equipment_id, part_id)
);
