CREATE TABLE idmacpedro (
  ididmacpedro VARCHAR(17) NOT NULL,
  nome VARCHAR(50) NULL,
  ativo TINYINT UNSIGNED NULL,
  PRIMARY KEY(ididmacpedro)
);

CREATE TABLE painelpedro (
  idpainelpedro INT(10) NOT NULL AUTO_INCREMENT,
  idmacpedro_ididmacpedro VARCHAR(17) NOT NULL,
  macpedro_idmacpedro VARCHAR(17) NULL,
  nome VARCHAR(50) NULL,
  ledr INT(10) NULL,
  ledb INT(10) NULL,
  ledg INT(10) NULL,
  linhaum VARCHAR(50) NULL,
  linhadois VARCHAR(50) NULL,
  datainicial DATE NULL,
  datafinal DATE NULL,
  PRIMARY KEY(idpainelpedro, idmacpedro_ididmacpedro),
  INDEX painelpedro_FKIndex1(idmacpedro_ididmacpedro),
  FOREIGN KEY(idmacpedro_ididmacpedro)
    REFERENCES idmacpedro(ididmacpedro)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION
);


