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



CREATE TABLE painelpam (
  idpainelpam INTEGER UNSIGNED  NOT NULL   AUTO_INCREMENT,
  macpam_idmacpam 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(idpainelpam)  ,
INDEX formpainelpam_FKIndex1(macpam_idmacpam),
  FOREIGN KEY(macpam_idmacpam)
    REFERENCES macpam(idmacpam)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION);




