mirror of
https://github.com/Such-Software/wownerogue.git
synced 2026-11-14 11:03:53 +01:00
A browser-based roguelike synchronized with crypto block timing. A run is a race against the next block: reach the exit before the block lands, or the house wins. The same codebase runs the solo dungeon, the social Tavern, and operator-selected PvP and race rulesets, with separate free and paid leaderboards. Self-hostable under the MIT License. See README.md to run it, docs/ARCHITECTURE.md for the design, and docs/DEPLOY.md to operate an instance.
23 lines
887 B
SQL
23 lines
887 B
SQL
-- Chat History Migration
|
|
-- Persistent storage for chat messages
|
|
|
|
-- Create chat_messages table
|
|
CREATE TABLE IF NOT EXISTS chat_messages (
|
|
id SERIAL PRIMARY KEY,
|
|
socket_id VARCHAR(255),
|
|
username VARCHAR(50),
|
|
message TEXT NOT NULL,
|
|
message_type VARCHAR(20) DEFAULT 'chat', -- 'chat', 'system', 'event'
|
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
-- Index for efficient retrieval of recent messages
|
|
CREATE INDEX IF NOT EXISTS idx_chat_messages_created_at ON chat_messages(created_at DESC);
|
|
|
|
-- Optional: Index for user-specific history lookups
|
|
CREATE INDEX IF NOT EXISTS idx_chat_messages_socket_id ON chat_messages(socket_id);
|
|
|
|
-- Comment on table
|
|
COMMENT ON TABLE chat_messages IS 'Stores chat message history for display to new users';
|
|
COMMENT ON COLUMN chat_messages.message_type IS 'Type of message: chat (user), system (server), event (game events)';
|