-- +migrate Up
CREATE TABLE appconfig (
  ticket_key VARCHAR(5),
  ticket_id INT
);

INSERT INTO appconfig (ticket_key, ticket_id) VALUES ('xpp', 1);

CREATE TABLE tickets (
    id SERIAL PRIMARY KEY,
    key VARCHAR(10),
    channelID VARCHAR(255),
    project_git VARCHAR(255),
    build_git VARCHAR(255),
    folder VARCHAR(255),

    created_at TIMESTAMPTZ DEFAULT current_timestamp,
    deleted_at TIMESTAMPTZ,
    updated_at TIMESTAMPTZ
);

CREATE TABLE tasks (
    id SERIAL PRIMARY KEY,
    creator VARCHAR(255),
    creator_link VARCHAR(255),
    messageID VARCHAR(255),

    description TEXT,
    assignee VARCHAR(255),

    created_at TIMESTAMPTZ DEFAULT current_timestamp,
    deleted_at TIMESTAMPTZ,
    updated_at TIMESTAMPTZ
);

-- +migrate Down
DROP TABLE tickets;
DROP TABLE appconfig;
DROP TABLE tasks;