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



CREATE TABLE painelmaria (
  idpainelmaria INTEGER UNSIGNED  NOT NULL   AUTO_INCREMENT,
  macmaria_idmacmaria 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(idpainelmaria)  ,
INDEX painelmaria_FKIndex1(macmaria_idmacmaria),
  FOREIGN KEY(macmaria_idmacmaria)
    REFERENCES macmaria(idmacmaria)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION);




