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



CREATE TABLE painelmateus (
  idpainelmateus INTEGER UNSIGNED  NOT NULL   AUTO_INCREMENT,
  macmateus_idmacmateus 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    ,
  prioridade_painel_mateus VARCHAR(1) NULL ,
  origem_painel_mateus VARCHAR(25) NULL ,
  destino_painel_mateus VARCHAR(25) NULL , 
PRIMARY KEY(idpainelmateus)  ,
INDEX painelmateus_FKIndex1(macmateus_idmacmateus),
  FOREIGN KEY(macmateus_idmacmateus)
    REFERENCES macmateus(idmacmateus)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION);




