CREATE TABLE bufra(
  dom INTEGER NOT NULL,
  ver INTEGER NOT NULL,
  cod INTEGER NOT NULL,
  dsc TEXT NOT NULL,
  PRIMARY KEY (dom, ver, cod)
  );

CREATE TABLE bufrbx(
  dom INTEGER NOT NULL,
  ver INTEGER NOT NULL,
  cls INTEGER NOT NULL,
  dsc TEXT NOT NULL,
  PRIMARY KEY (dom, ver, cls)
  );

CREATE TABLE bufrb(
  dom INTEGER NOT NULL,
  ver INTEGER NOT NULL,
  cls INTEGER NOT NULL,
  cod INTEGER NOT NULL,
  uni TEXT NOT NULL,
  wid INTEGER NOT NULL,
  scl INTEGER NOT NULL,
  rfv INTEGER NOT NULL,
  dsc TEXT NOT NULL,
  sta TEXT NOT NULL,
  PRIMARY KEY (dom, ver, cls, cod)
  );

CREATE TABLE bufrdx(
  dom INTEGER NOT NULL,
  ver INTEGER NOT NULL,
  cls INTEGER NOT NULL,
  dsc TEXT NOT NULL,
  PRIMARY KEY (dom, ver, cls)
  );

CREATE TABLE bufrdy(
  dom INTEGER NOT NULL,
  ver INTEGER NOT NULL,
  cls INTEGER NOT NULL,
  cod INTEGER NOT NULL,
  dsc TEXT NOT NULL,
  PRIMARY KEY (dom, ver, cls, cod)
  );

CREATE TABLE bufrd(
  dom INTEGER NOT NULL,
  ver INTEGER NOT NULL,
  cls INTEGER NOT NULL,
  cod INTEGER NOT NULL,
  pos INTEGER NOT NULL,
  f INTEGER NOT NULL,
  x INTEGER NOT NULL,
  y INTEGER NOT NULL,
  dsc TEXT NOT NULL,
  sta TEXT NOT NULL,
  PRIMARY KEY (dom, ver, cls, cod, pos)
  );
