CREATE TABLE macmilena (
  idmacmilena VARCHAR(17) NOT NULL,
  nome VARCHAR(50) NULL,
  ativo BOOL NULL,
  PRIMARY KEY(idmacmilena)
);

CREATE TABLE painelmilena (
  idpainelmilena INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  macmilena_idmacmilena VARCHAR(17) NOT NULL,
  nome VARCHAR(50) NULL,
  ledr INTEGER UNSIGNED NULL,
  ledg INTEGER UNSIGNED NULL,
  ledb INTEGER UNSIGNED NULL,
  linhaum VARCHAR(50) NULL,
  linhadois VARCHAR(50) NULL,
  datainicial DATE NULL,
  datafinal DATE NULL,
  PRIMARY KEY(idpainelmilena),
  INDEX painelmilena_FKIndex1(macmilena_idmacmilena),
  FOREIGN KEY(macmilena_idmacmilena)
    REFERENCES macmilena(idmacmilena)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION
);


