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



CREATE TABLE painelduarte (
  idpainelduarte INTEGER UNSIGNED  NOT NULL   AUTO_INCREMENT,
  macduarte_idmacduarte 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(idpainelduarte)  ,
INDEX painelduarte_FKIndex1(macduarte_idmacduarte),
  FOREIGN KEY(macduarte_idmacduarte)
    REFERENCES macduarte(idmacduarte)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION);




