START TRANSACTION;

CREATE TYPE bot_sync_status_statuses AS ENUM('SUCCESS', 'FAIL');

CREATE TABLE IF NOT EXISTS bot_sync_status
(
    id      BIGSERIAL PRIMARY KEY,
    status  bot_sync_status_statuses NOT NULL ,
    date    TIMESTAMP NOT NULL,
    errors  JSONB NOT NULL
);

COMMENT ON TABLE bot_sync_status IS 'Status of last sync with bot.';

COMMIT;
