- Migration: added subdomain, server_ip, server_port columns - Seed: rewritten with hardcoded identifiers + full subdomain/IP/port data from Chronicler #87 audit (no more Pterodactyl API dependency) - Route: POST /:id/provision-subdomain creates A + SRV records via Cloudflare API, saves subdomain to server_config - Card: subdomain section shows FQDN if provisioned, provision button with inline input if not Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
28 lines
961 B
SQL
28 lines
961 B
SQL
-- Migration 139: Server Command Center — server_config table
|
|
-- Creates the foundation for short_name-based Discord channel detection
|
|
-- and server management from Trinity Console.
|
|
|
|
CREATE TABLE IF NOT EXISTS server_config (
|
|
server_identifier VARCHAR(36) PRIMARY KEY,
|
|
short_name VARCHAR(64) UNIQUE,
|
|
short_name_locked BOOLEAN DEFAULT false,
|
|
display_name VARCHAR(128),
|
|
subdomain VARCHAR(64) UNIQUE,
|
|
server_ip VARCHAR(45),
|
|
server_port INTEGER DEFAULT 25565,
|
|
restart_enabled BOOLEAN DEFAULT true,
|
|
restart_offset_minutes INTEGER DEFAULT 0,
|
|
node VARCHAR(8),
|
|
pterodactyl_name VARCHAR(128),
|
|
created_at TIMESTAMP DEFAULT NOW(),
|
|
updated_at TIMESTAMP DEFAULT NOW()
|
|
);
|
|
|
|
-- Index for fast short_name lookups (channel detection)
|
|
CREATE INDEX IF NOT EXISTS idx_server_config_short_name
|
|
ON server_config (short_name);
|
|
|
|
-- Index for node-based queries (matrix grouping)
|
|
CREATE INDEX IF NOT EXISTS idx_server_config_node
|
|
ON server_config (node);
|