CREATE TABLE broadcasts (
  id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(),
  music_session_id VARCHAR(64) NOT NULL REFERENCES music_sessions(id) ON DELETE CASCADE,
  user_id VARCHAR(64) NOT NULL REFERENCES users(id) ON DELETE CASCADE,
  broadcast_id VARCHAR NOT NULL,
  stream_id VARCHAR,
  broadcast_status VARCHAR,
  stream_status VARCHAR,
  stream_name VARCHAR,
  stream_address VARCHAR,
  broadcast_data VARCHAR,
  stream_data VARCHAR,
  created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

CREATE INDEX idx_broadcast_broadcast_id ON broadcasts USING BTREE(broadcast_id);
CREATE INDEX idx_broadcast_status ON broadcasts USING BTREE(broadcast_status);
CREATE INDEX idx_stream_status ON broadcasts USING BTREE(stream_status);

CREATE INDEX idx_broadcast_music_session_id ON broadcasts USING BTREE(music_session_id);
