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



CREATE TABLE painelpedro (
  idpainelpedro INTEGER UNSIGNED  NOT NULL   AUTO_INCREMENT,
  macpedro_idmacpedro 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(idpainelpedro)  ,
INDEX painelpedro_FKIndex1(macpedro_idmacpedro),
  FOREIGN KEY(macpedro_idmacpedro)
    REFERENCES macpedro(idmacpedro)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION);




