mirror of
https://github.com/xtr-dev/rondevu-server.git
synced 2025-12-10 10:53:24 +00:00
Simplify API: remove topics, rename session→offer
- Remove topic-based grouping and discovery - Rename sessions to offers for clarity - Simplify to just POST /offer, POST /answer, POST /poll - Add version to health endpoint - Update database schema (sessions→offers table) - Reduce offer timeout to 1 minute - Server version: 0.0.1 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
22
migrations/0002_remove_topics.sql
Normal file
22
migrations/0002_remove_topics.sql
Normal file
@@ -0,0 +1,22 @@
|
||||
-- Remove topics and rename sessions to offers
|
||||
-- This is a breaking change requiring a fresh database
|
||||
|
||||
-- Drop old sessions table
|
||||
DROP TABLE IF EXISTS sessions;
|
||||
|
||||
-- Create offers table (without topic)
|
||||
CREATE TABLE offers (
|
||||
code TEXT PRIMARY KEY,
|
||||
origin TEXT NOT NULL,
|
||||
peer_id TEXT NOT NULL CHECK(length(peer_id) <= 1024),
|
||||
offer TEXT NOT NULL,
|
||||
answer TEXT,
|
||||
offer_candidates TEXT NOT NULL DEFAULT '[]',
|
||||
answer_candidates TEXT NOT NULL DEFAULT '[]',
|
||||
created_at INTEGER NOT NULL,
|
||||
expires_at INTEGER NOT NULL
|
||||
);
|
||||
|
||||
-- Create indexes for efficient queries
|
||||
CREATE INDEX idx_offers_expires_at ON offers(expires_at);
|
||||
CREATE INDEX idx_offers_origin ON offers(origin);
|
||||
Reference in New Issue
Block a user