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



CREATE TABLE painelash (
  idpainelash INTEGER UNSIGNED  NOT NULL   AUTO_INCREMENT,
  macash_idmacash 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(idpainelash)  ,
INDEX painelash_FKIndex1(macash_idmacash),
  FOREIGN KEY(macash_idmacash)
    REFERENCES macash(idmacash)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION);




