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



CREATE TABLE painelmiguel (
  idpainelmiguel INTEGER UNSIGNED  NOT NULL   AUTO_INCREMENT,
  macmiguel_idmacmiguel 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(idpainelmiguel)  ,
INDEX painelmiguel_FKIndex1(macmiguel_idmacmiguel),
  FOREIGN KEY(macmiguel_idmacmiguel)
    REFERENCES macmiguel(idmacmiguel)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION);




