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



CREATE TABLE painelribeiro (
  idpainelribeiro INTEGER UNSIGNED  NOT NULL   AUTO_INCREMENT,
  macribeiro_idmacribeiro 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(idpainelribeiro)  ,
INDEX painelribeiro_FKIndex1(macribeiro_idmacribeiro),
  FOREIGN KEY(macribeiro_idmacribeiro)
    REFERENCES macribeiro(idmacribeiro)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION);




