Files
Applications/LCDLLN-GPT/server-master/scripts/schema.sql
T
2026-03-16 18:26:47 +01:00

27 lines
716 B
SQL

CREATE DATABASE IF NOT EXISTS lcdlln;
USE lcdlln;
CREATE TABLE IF NOT EXISTS users (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
email VARCHAR(255) UNIQUE NOT NULL,
username VARCHAR(50) UNIQUE NOT NULL,
password_hash CHAR(128) NOT NULL,
server_salt CHAR(32) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
active_session BIGINT DEFAULT NULL
);
CREATE TABLE IF NOT EXISTS shards (
id INT AUTO_INCREMENT PRIMARY KEY,
shard_id VARCHAR(50) UNIQUE NOT NULL,
max_capacity INT NOT NULL,
current_load INT DEFAULT 0,
last_heartbeat TIMESTAMP
);
CREATE TABLE IF NOT EXISTS schema_version (
version INT NOT NULL,
applied_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);