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



CREATE TABLE painelallang (
  idpainelallang INTEGER UNSIGNED  NOT NULL   AUTO_INCREMENT,
  macallang_idmacallang 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(idpainelallang)  ,
INDEX painelallang_FKIndex1(macallang_idmacallang),
  FOREIGN KEY(macallang_idmacallang)
    REFERENCES macallang(idmacallang)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION);




