CREATE TABLE pbx_message_wpp (
  id SERIAL NOT NULL PRIMARY KEY,
  uniqueid character varying NOT NULL,
  src character varying NOT NULL,
  dst character varying NOT NULL,
  type character varying NOT NULL,
  content character varying NOT NULL,
  profile_name character varying NOT NULL,
  msg_date timestamp WITHOUT TIME ZONW DEFAULT(NOW())
);

ALTER TABLE
  pbx_queues_grupos
ADD
  COLUMN midiafila VARCHAR(1);

ALTER TABLE
  pbx_sip_ramais
ADD
  COLUMN midiaramal VARCHAR(1);

CREATE TABLE md_supervisor (
  id SERIAL NOT NULL PRIMARY KEY,
  ramal character varying NOT NULL,
  matricula character varying NULL,
  nome character varying NULL,
  tempo_login timestamp NULL,
  cliente_id character varying NULL,
  fila character varying NULL,
  status character varying NULL,
  duracao timestamp NULL,
  uniqueid character varying NULL DEFAULT '',
  status_agente int NOT NULL DEFAULT 0,
  motivo_pausa character varying NULL,
  chamada_classificado int NOT NULL DEFAULT 1
);

ALTER TABLE
  md_message
add
  COLUMN mimetype character varying NOT null,
add
  COLUMN id_provedor character varying NOT null,
add
  COLUMN file_name character varying NOT NULL;