-- Assembly set lines
CREATE TABLE llx_prod_assemblyrule (
  rowid integer AUTO_INCREMENT PRIMARY KEY,
  fk_assemblyset integer NOT NULL,
  fk_product integer NOT NULL,
  qty double DEFAULT 1 NOT NULL,
  note text NULL,
  entity integer DEFAULT 1 NOT NULL,
  tms timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  datec datetime NULL
) ENGINE=innodb;

ALTER TABLE llx_prod_assemblyrule ADD UNIQUE INDEX uk_prod_assemblyrule (fk_assemblyset, fk_product, entity);
ALTER TABLE llx_prod_assemblyrule ADD INDEX idx_prod_assemblyrule_set (fk_assemblyset);
