{ "id": "039fb91d-ed56-4b78-8ee4-4732638e763a", "prevId": "00000000-0000-0000-0000-000000000000", "version": "7", "dialect": "postgresql", "tables": { "public.app_settings": { "name": "app_settings", "schema": "", "columns": { "key": { "name": "key", "type": "text", "primaryKey": true, "notNull": true }, "value": { "name": "value", "type": "jsonb", "primaryKey": false, "notNull": true } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.games": { "name": "games", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true, "default": "'pending'" }, "white_id": { "name": "white_id", "type": "text", "primaryKey": false, "notNull": true }, "black_id": { "name": "black_id", "type": "text", "primaryKey": false, "notNull": true }, "created_by": { "name": "created_by", "type": "text", "primaryKey": false, "notNull": false }, "schedule_id": { "name": "schedule_id", "type": "text", "primaryKey": false, "notNull": false }, "flags": { "name": "flags", "type": "jsonb", "primaryKey": false, "notNull": true }, "personas": { "name": "personas", "type": "jsonb", "primaryKey": false, "notNull": true }, "rated": { "name": "rated", "type": "boolean", "primaryKey": false, "notNull": true, "default": true }, "start_fen": { "name": "start_fen", "type": "text", "primaryKey": false, "notNull": true }, "fen": { "name": "fen", "type": "text", "primaryKey": false, "notNull": true }, "ply": { "name": "ply", "type": "integer", "primaryKey": false, "notNull": true, "default": 0 }, "pending_draw_by": { "name": "pending_draw_by", "type": "text", "primaryKey": false, "notNull": false }, "result": { "name": "result", "type": "text", "primaryKey": false, "notNull": false }, "termination": { "name": "termination", "type": "text", "primaryKey": false, "notNull": false }, "starts_at": { "name": "starts_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": false }, "started_at": { "name": "started_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": false }, "finished_at": { "name": "finished_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": false }, "rating_change": { "name": "rating_change", "type": "jsonb", "primaryKey": false, "notNull": false }, "accuracy": { "name": "accuracy", "type": "jsonb", "primaryKey": false, "notNull": false }, "interviews": { "name": "interviews", "type": "jsonb", "primaryKey": false, "notNull": true, "default": "'{}'::jsonb" }, "last_words": { "name": "last_words", "type": "jsonb", "primaryKey": false, "notNull": true, "default": "'{}'::jsonb" }, "review": { "name": "review", "type": "jsonb", "primaryKey": false, "notNull": false }, "thumbnail": { "name": "thumbnail", "type": "text", "primaryKey": false, "notNull": false }, "thumbnail_caption": { "name": "thumbnail_caption", "type": "text", "primaryKey": false, "notNull": false }, "thumbnail_meta": { "name": "thumbnail_meta", "type": "jsonb", "primaryKey": false, "notNull": false }, "cost_total": { "name": "cost_total", "type": "double precision", "primaryKey": false, "notNull": true, "default": 0 }, "error": { "name": "error", "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": { "games_status": { "name": "games_status", "columns": [ { "expression": "status", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} }, "games_created": { "name": "games_created", "columns": [ { "expression": "created_at", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "games_white_id_players_id_fk": { "name": "games_white_id_players_id_fk", "tableFrom": "games", "tableTo": "players", "columnsFrom": [ "white_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "games_black_id_players_id_fk": { "name": "games_black_id_players_id_fk", "tableFrom": "games", "tableTo": "players", "columnsFrom": [ "black_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "games_created_by_users_id_fk": { "name": "games_created_by_users_id_fk", "tableFrom": "games", "tableTo": "users", "columnsFrom": [ "created_by" ], "columnsTo": [ "id" ], "onDelete": "set null", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.moves": { "name": "moves", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "game_id": { "name": "game_id", "type": "text", "primaryKey": false, "notNull": true }, "ply": { "name": "ply", "type": "integer", "primaryKey": false, "notNull": true }, "side": { "name": "side", "type": "text", "primaryKey": false, "notNull": true }, "player_id": { "name": "player_id", "type": "text", "primaryKey": false, "notNull": true }, "san": { "name": "san", "type": "text", "primaryKey": false, "notNull": false }, "uci": { "name": "uci", "type": "text", "primaryKey": false, "notNull": true }, "fen_after": { "name": "fen_after", "type": "text", "primaryKey": false, "notNull": true }, "phrase": { "name": "phrase", "type": "text", "primaryKey": false, "notNull": false }, "note": { "name": "note", "type": "text", "primaryKey": false, "notNull": false }, "offered_draw": { "name": "offered_draw", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, "illegal": { "name": "illegal", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, "think_ms": { "name": "think_ms", "type": "integer", "primaryKey": false, "notNull": true, "default": 0 }, "usage": { "name": "usage", "type": "jsonb", "primaryKey": false, "notNull": false }, "eval": { "name": "eval", "type": "jsonb", "primaryKey": false, "notNull": false }, "classification": { "name": "classification", "type": "text", "primaryKey": false, "notNull": false }, "accuracy": { "name": "accuracy", "type": "double precision", "primaryKey": false, "notNull": false }, "turn_id": { "name": "turn_id", "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": { "moves_game_ply": { "name": "moves_game_ply", "columns": [ { "expression": "game_id", "isExpression": false, "asc": true, "nulls": "last" }, { "expression": "ply", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": true, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "moves_game_id_games_id_fk": { "name": "moves_game_id_games_id_fk", "tableFrom": "moves", "tableTo": "games", "columnsFrom": [ "game_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.players": { "name": "players", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "kind": { "name": "kind", "type": "text", "primaryKey": false, "notNull": true }, "slug": { "name": "slug", "type": "text", "primaryKey": false, "notNull": true }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": false }, "display_name": { "name": "display_name", "type": "text", "primaryKey": false, "notNull": true }, "family": { "name": "family", "type": "text", "primaryKey": false, "notNull": false }, "provider": { "name": "provider", "type": "text", "primaryKey": false, "notNull": false }, "model_id": { "name": "model_id", "type": "text", "primaryKey": false, "notNull": false }, "thinking": { "name": "thinking", "type": "text", "primaryKey": false, "notNull": false }, "variant": { "name": "variant", "type": "text", "primaryKey": false, "notNull": false }, "avatar": { "name": "avatar", "type": "text", "primaryKey": false, "notNull": false }, "color": { "name": "color", "type": "text", "primaryKey": false, "notNull": false }, "dumb": { "name": "dumb", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, "skull": { "name": "skull", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, "options": { "name": "options", "type": "jsonb", "primaryKey": false, "notNull": true, "default": "'{}'::jsonb" }, "active": { "name": "active", "type": "boolean", "primaryKey": false, "notNull": true, "default": true }, "rating": { "name": "rating", "type": "double precision", "primaryKey": false, "notNull": true, "default": 1500 }, "rd": { "name": "rd", "type": "double precision", "primaryKey": false, "notNull": true, "default": 350 }, "vol": { "name": "vol", "type": "double precision", "primaryKey": false, "notNull": true, "default": 0.06 }, "games": { "name": "games", "type": "integer", "primaryKey": false, "notNull": true, "default": 0 }, "wins": { "name": "wins", "type": "integer", "primaryKey": false, "notNull": true, "default": 0 }, "draws": { "name": "draws", "type": "integer", "primaryKey": false, "notNull": true, "default": 0 }, "losses": { "name": "losses", "type": "integer", "primaryKey": false, "notNull": true, "default": 0 }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": {}, "foreignKeys": { "players_user_id_users_id_fk": { "name": "players_user_id_users_id_fk", "tableFrom": "players", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "set null", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "players_slug_unique": { "name": "players_slug_unique", "nullsNotDistinct": false, "columns": [ "slug" ] }, "players_user_id_unique": { "name": "players_user_id_unique", "nullsNotDistinct": false, "columns": [ "user_id" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.predictions": { "name": "predictions", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "game_id": { "name": "game_id", "type": "text", "primaryKey": false, "notNull": true }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": true }, "pick": { "name": "pick", "type": "text", "primaryKey": false, "notNull": true }, "points": { "name": "points", "type": "integer", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": { "predictions_game_user": { "name": "predictions_game_user", "columns": [ { "expression": "game_id", "isExpression": false, "asc": true, "nulls": "last" }, { "expression": "user_id", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": true, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "predictions_game_id_games_id_fk": { "name": "predictions_game_id_games_id_fk", "tableFrom": "predictions", "tableTo": "games", "columnsFrom": [ "game_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "predictions_user_id_users_id_fk": { "name": "predictions_user_id_users_id_fk", "tableFrom": "predictions", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.rating_history": { "name": "rating_history", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "player_id": { "name": "player_id", "type": "text", "primaryKey": false, "notNull": true }, "game_id": { "name": "game_id", "type": "text", "primaryKey": false, "notNull": true }, "before": { "name": "before", "type": "double precision", "primaryKey": false, "notNull": true }, "after": { "name": "after", "type": "double precision", "primaryKey": false, "notNull": true }, "rd": { "name": "rd", "type": "double precision", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": { "rating_history_player": { "name": "rating_history_player", "columns": [ { "expression": "player_id", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.schedules": { "name": "schedules", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true }, "enabled": { "name": "enabled", "type": "boolean", "primaryKey": false, "notNull": true, "default": true }, "interval_minutes": { "name": "interval_minutes", "type": "integer", "primaryKey": false, "notNull": true, "default": 180 }, "announce_minutes": { "name": "announce_minutes", "type": "integer", "primaryKey": false, "notNull": true, "default": 30 }, "pool": { "name": "pool", "type": "jsonb", "primaryKey": false, "notNull": true, "default": "'[]'::jsonb" }, "flags": { "name": "flags", "type": "jsonb", "primaryKey": false, "notNull": true }, "random_personas": { "name": "random_personas", "type": "boolean", "primaryKey": false, "notNull": true, "default": true }, "next_run_at": { "name": "next_run_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": false }, "created_by": { "name": "created_by", "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.sessions": { "name": "sessions", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "expires_at": { "name": "expires_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true } }, "indexes": {}, "foreignKeys": { "sessions_user_id_users_id_fk": { "name": "sessions_user_id_users_id_fk", "tableFrom": "sessions", "tableTo": "users", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.turns": { "name": "turns", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "game_id": { "name": "game_id", "type": "text", "primaryKey": false, "notNull": true }, "ply": { "name": "ply", "type": "integer", "primaryKey": false, "notNull": true }, "side": { "name": "side", "type": "text", "primaryKey": false, "notNull": true }, "player_id": { "name": "player_id", "type": "text", "primaryKey": false, "notNull": true }, "attempt": { "name": "attempt", "type": "integer", "primaryKey": false, "notNull": true, "default": 1 }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true, "default": "'running'" }, "transcript": { "name": "transcript", "type": "jsonb", "primaryKey": false, "notNull": true, "default": "'[]'::jsonb" }, "usage": { "name": "usage", "type": "jsonb", "primaryKey": false, "notNull": false }, "outcome": { "name": "outcome", "type": "text", "primaryKey": false, "notNull": false }, "error": { "name": "error", "type": "text", "primaryKey": false, "notNull": false }, "started_at": { "name": "started_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" }, "ended_at": { "name": "ended_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": false } }, "indexes": { "turns_game_ply": { "name": "turns_game_ply", "columns": [ { "expression": "game_id", "isExpression": false, "asc": true, "nulls": "last" }, { "expression": "ply", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "turns_game_id_games_id_fk": { "name": "turns_game_id_games_id_fk", "tableFrom": "turns", "tableTo": "games", "columnsFrom": [ "game_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.usage_ledger": { "name": "usage_ledger", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": false }, "game_id": { "name": "game_id", "type": "text", "primaryKey": false, "notNull": false }, "player_id": { "name": "player_id", "type": "text", "primaryKey": false, "notNull": false }, "kind": { "name": "kind", "type": "text", "primaryKey": false, "notNull": true }, "model": { "name": "model", "type": "text", "primaryKey": false, "notNull": true }, "usage": { "name": "usage", "type": "jsonb", "primaryKey": false, "notNull": true }, "cost": { "name": "cost", "type": "double precision", "primaryKey": false, "notNull": true, "default": 0 }, "tokens": { "name": "tokens", "type": "integer", "primaryKey": false, "notNull": true, "default": 0 }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": { "usage_user": { "name": "usage_user", "columns": [ { "expression": "user_id", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.users": { "name": "users", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "username": { "name": "username", "type": "text", "primaryKey": false, "notNull": true }, "password_hash": { "name": "password_hash", "type": "text", "primaryKey": false, "notNull": true }, "display_name": { "name": "display_name", "type": "text", "primaryKey": false, "notNull": true }, "avatar": { "name": "avatar", "type": "text", "primaryKey": false, "notNull": false }, "is_admin": { "name": "is_admin", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, "onboarded": { "name": "onboarded", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, "theme": { "name": "theme", "type": "text", "primaryKey": false, "notNull": true, "default": "'tabloid'" }, "created_at": { "name": "created_at", "type": "timestamp with time zone", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": { "users_username_lower": { "name": "users_username_lower", "columns": [ { "expression": "lower(\"username\")", "asc": true, "isExpression": true, "nulls": "last" } ], "isUnique": true, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false } }, "enums": {}, "schemas": {}, "sequences": {}, "roles": {}, "policies": {}, "views": {}, "_meta": { "columns": {}, "schemas": {}, "tables": {} } }