-- 003_channels.sql
CREATE TYPE channel_status AS ENUM ('connecting', 'connected', 'disconnected');

CREATE TABLE channels (
  id                UUID           PRIMARY KEY DEFAULT gen_random_uuid(),
  name              VARCHAR(255)   NOT NULL,
  phone_number      VARCHAR(20)    NOT NULL,
  status            channel_status NOT NULL DEFAULT 'disconnected',
  session_data      JSONB,
  created_at        TIMESTAMPTZ    NOT NULL DEFAULT NOW(),
  last_connected_at TIMESTAMPTZ
);
