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

CREATE TABLE painelerik (
  idpainelerik INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  macerik_idmacerik 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(idpainelerik),
  INDEX painelerik_FKIndex1(macerik_idmacerik),
  FOREIGN KEY(macerik_idmacerik)
    REFERENCES macerik(idmacerik)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION
);


