CREATE TABLE macana (
  idmacana VARCHAR(17)  NOT NULL  ,
  nome VARCHAR(50)  NULL  ,
  atio BOOL  NULL    ,
PRIMARY KEY(idmacana));



CREATE TABLE painelana (
  idpainelana INTEGER UNSIGNED  NOT NULL   AUTO_INCREMENT,
  macana_idmacana 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(idpainelana)  ,
INDEX painelana_FKIndex1(macana_idmacana),
  FOREIGN KEY(macana_idmacana)
    REFERENCES macana(idmacana)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION);




