-- migrate:up
CREATE TABLE endorse_detail (
  id INT AUTO_INCREMENT PRIMARY KEY,
  endorse_id INT NOT NULL,
  part_number VARCHAR(100) NOT NULL,
  quantity INT NOT NULL,
  price DECIMAL(10, 2) DEFAULT NULL,
  subtotal DECIMAL(10, 2) DEFAULT NULL,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  FOREIGN KEY (endorse_id) REFERENCES endorse(id) ON DELETE CASCADE
);

-- migrate:down
DROP TABLE IF EXISTS endorse_detail;
