-- Minimal chat schema for Supabase
CREATE TABLE IF NOT EXISTS messages (
  id SERIAL PRIMARY KEY,
  channel_id VARCHAR(255) NOT NULL,
  user_id UUID NOT NULL,
  username VARCHAR(255),
  text TEXT NOT NULL,
  created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);

-- Optionally, create a channels table
CREATE TABLE IF NOT EXISTS channels (
  id VARCHAR(255) PRIMARY KEY,
  name VARCHAR(255) NOT NULL,
  type VARCHAR(50) DEFAULT 'text'
);
