{ "version": "6", "dialect": "sqlite", "id": "05bc871d-07db-45ed-9501-8d65bbce33c6", "prevId": "4e2806dd-1d29-4921-b818-b4f882ba9d73", "tables": { "admin_accounts": { "name": "admin_accounts", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "role": { "name": "role", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "key_hash": { "name": "key_hash", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "enabled": { "name": "enabled", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 1 }, "session_generation": { "name": "session_generation", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 0 }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "updated_at": { "name": "updated_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": { "admin_accounts_key_hash_unique": { "name": "admin_accounts_key_hash_unique", "columns": [ "key_hash" ], "isUnique": true } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": { "admin_accounts_role": { "name": "admin_accounts_role", "value": "\"admin_accounts\".\"role\" IN ('owner', 'operator', 'viewer')" }, "admin_accounts_enabled": { "name": "admin_accounts_enabled", "value": "\"admin_accounts\".\"enabled\" IN (0, 1)" }, "admin_accounts_generation": { "name": "admin_accounts_generation", "value": "\"admin_accounts\".\"session_generation\" >= 0" } } }, "admin_audit": { "name": "admin_audit", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "actor_admin_id": { "name": "actor_admin_id", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "target_admin_id": { "name": "target_admin_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "action": { "name": "action", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "detail": { "name": "detail", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'{}'" } }, "indexes": { "admin_audit_created_at": { "name": "admin_audit_created_at", "columns": [ "created_at" ], "isUnique": false } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "admin_room_audit": { "name": "admin_room_audit", "columns": { "operation_id": { "name": "operation_id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "actor_admin_id": { "name": "actor_admin_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "room_code": { "name": "room_code", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "action": { "name": "action", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'room_control'" }, "reason": { "name": "reason", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "expected_revision": { "name": "expected_revision", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "before_paused": { "name": "before_paused", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "before_join_locked": { "name": "before_join_locked", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "after_paused": { "name": "after_paused", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "after_join_locked": { "name": "after_join_locked", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": { "admin_room_audit_room": { "name": "admin_room_audit_room", "columns": [ "room_code", "created_at" ], "isUnique": false } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "admin_room_creations": { "name": "admin_room_creations", "columns": { "operation_id": { "name": "operation_id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "actor_admin_id": { "name": "actor_admin_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "room_code": { "name": "room_code", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "host_id": { "name": "host_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "request_hash": { "name": "request_hash", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "session_hash": { "name": "session_hash", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "configuration": { "name": "configuration", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "reason": { "name": "reason", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": { "admin_room_creations_session_hash_unique": { "name": "admin_room_creations_session_hash_unique", "columns": [ "session_hash" ], "isUnique": true }, "admin_room_creations_room": { "name": "admin_room_creations_room", "columns": [ "room_code", "created_at" ], "isUnique": false } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "admin_sessions": { "name": "admin_sessions", "columns": { "token_hash": { "name": "token_hash", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "id": { "name": "id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "admin_id": { "name": "admin_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "generation": { "name": "generation", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "expires_at": { "name": "expires_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "revoked_at": { "name": "revoked_at", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false } }, "indexes": { "admin_sessions_id_unique": { "name": "admin_sessions_id_unique", "columns": [ "id" ], "isUnique": true }, "admin_sessions_account": { "name": "admin_sessions_account", "columns": [ "admin_id" ], "isUnique": false } }, "foreignKeys": { "admin_sessions_admin_id_admin_accounts_id_fk": { "name": "admin_sessions_admin_id_admin_accounts_id_fk", "tableFrom": "admin_sessions", "tableTo": "admin_accounts", "columnsFrom": [ "admin_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "room_controls": { "name": "room_controls", "columns": { "room_code": { "name": "room_code", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "paused": { "name": "paused", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 0 }, "join_locked": { "name": "join_locked", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 0 }, "revision": { "name": "revision", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 0 }, "updated_at": { "name": "updated_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": {}, "foreignKeys": { "room_controls_room_code_rooms_code_fk": { "name": "room_controls_room_code_rooms_code_fk", "tableFrom": "room_controls", "tableTo": "rooms", "columnsFrom": [ "room_code" ], "columnsTo": [ "code" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": { "room_controls_paused": { "name": "room_controls_paused", "value": "\"room_controls\".\"paused\" IN (0, 1)" }, "room_controls_join_locked": { "name": "room_controls_join_locked", "value": "\"room_controls\".\"join_locked\" IN (0, 1)" }, "room_controls_revision": { "name": "room_controls_revision", "value": "\"room_controls\".\"revision\" >= 0" } } }, "room_entry_receipts": { "name": "room_entry_receipts", "columns": { "operation_hash": { "name": "operation_hash", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "request_hash": { "name": "request_hash", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "session_hash": { "name": "session_hash", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "room_code": { "name": "room_code", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "player_id": { "name": "player_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": {}, "foreignKeys": { "room_entry_receipts_room_code_rooms_code_fk": { "name": "room_entry_receipts_room_code_rooms_code_fk", "tableFrom": "room_entry_receipts", "tableTo": "rooms", "columnsFrom": [ "room_code" ], "columnsTo": [ "code" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "room_messages": { "name": "room_messages", "columns": { "sequence": { "name": "sequence", "type": "integer", "primaryKey": true, "notNull": true, "autoincrement": true }, "room_code": { "name": "room_code", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "id": { "name": "id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "sender_id": { "name": "sender_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "sender_session_hash": { "name": "sender_session_hash", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "sender_name": { "name": "sender_name", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "sender_faction": { "name": "sender_faction", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "recipient_id": { "name": "recipient_id", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "recipient_name": { "name": "recipient_name", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "body": { "name": "body", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "created_at": { "name": "created_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": { "room_messages_room_id": { "name": "room_messages_room_id", "columns": [ "room_code", "id" ], "isUnique": true }, "room_messages_channel": { "name": "room_messages_channel", "columns": [ "room_code", "recipient_id", "sequence" ], "isUnique": false }, "room_messages_sender": { "name": "room_messages_sender", "columns": [ "room_code", "sender_id", "created_at" ], "isUnique": false } }, "foreignKeys": { "room_messages_room_code_rooms_code_fk": { "name": "room_messages_room_code_rooms_code_fk", "tableFrom": "room_messages", "tableTo": "rooms", "columnsFrom": [ "room_code" ], "columnsTo": [ "code" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "rooms": { "name": "rooms", "columns": { "code": { "name": "code", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "state": { "name": "state", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "version": { "name": "version", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 0 }, "updated_at": { "name": "updated_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": { "rooms_updated_at": { "name": "rooms_updated_at", "columns": [ "updated_at" ], "isUnique": false } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "seat_ai_delegations": { "name": "seat_ai_delegations", "columns": { "room_code": { "name": "room_code", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "owner_id": { "name": "owner_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "grant_id": { "name": "grant_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "delegate_id": { "name": "delegate_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "difficulty": { "name": "difficulty", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "owner_session_hash": { "name": "owner_session_hash", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "delegate_session_hash": { "name": "delegate_session_hash", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "expires_at": { "name": "expires_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "used_at": { "name": "used_at", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "revoked_at": { "name": "revoked_at", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false } }, "indexes": { "seat_ai_delegations_grant_id_unique": { "name": "seat_ai_delegations_grant_id_unique", "columns": [ "grant_id" ], "isUnique": true } }, "foreignKeys": { "seat_ai_delegations_room_code_rooms_code_fk": { "name": "seat_ai_delegations_room_code_rooms_code_fk", "tableFrom": "seat_ai_delegations", "tableTo": "rooms", "columnsFrom": [ "room_code" ], "columnsTo": [ "code" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": { "seat_ai_delegations_room_code_owner_id_grant_id_pk": { "columns": [ "room_code", "owner_id", "grant_id" ], "name": "seat_ai_delegations_room_code_owner_id_grant_id_pk" } }, "uniqueConstraints": {}, "checkConstraints": {} }, "seat_handover_claim_receipts": { "name": "seat_handover_claim_receipts", "columns": { "room_code": { "name": "room_code", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "player_id": { "name": "player_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "operation_hash": { "name": "operation_hash", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "offer_hash": { "name": "offer_hash", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "secret_hash": { "name": "secret_hash", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "session_hash": { "name": "session_hash", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "claim_fence": { "name": "claim_fence", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "claimed_at": { "name": "claimed_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": { "seat_handover_claim_receipts_claim_fence_unique": { "name": "seat_handover_claim_receipts_claim_fence_unique", "columns": [ "claim_fence" ], "isUnique": true } }, "foreignKeys": { "seat_handover_claim_receipts_room_code_rooms_code_fk": { "name": "seat_handover_claim_receipts_room_code_rooms_code_fk", "tableFrom": "seat_handover_claim_receipts", "tableTo": "rooms", "columnsFrom": [ "room_code" ], "columnsTo": [ "code" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": { "seat_handover_claim_receipts_room_code_player_id_operation_hash_pk": { "columns": [ "room_code", "player_id", "operation_hash" ], "name": "seat_handover_claim_receipts_room_code_player_id_operation_hash_pk" } }, "uniqueConstraints": {}, "checkConstraints": {} }, "seat_handover_offers": { "name": "seat_handover_offers", "columns": { "room_code": { "name": "room_code", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "player_id": { "name": "player_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "offer_hash": { "name": "offer_hash", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "secret_hash": { "name": "secret_hash", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "issuer_session_hash": { "name": "issuer_session_hash", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "expires_at": { "name": "expires_at", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "claim_operation_hash": { "name": "claim_operation_hash", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "session_hash": { "name": "session_hash", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "claimed_at": { "name": "claimed_at", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false } }, "indexes": { "seat_handover_offers_offer_hash_unique": { "name": "seat_handover_offers_offer_hash_unique", "columns": [ "offer_hash" ], "isUnique": true } }, "foreignKeys": { "seat_handover_offers_room_code_rooms_code_fk": { "name": "seat_handover_offers_room_code_rooms_code_fk", "tableFrom": "seat_handover_offers", "tableTo": "rooms", "columnsFrom": [ "room_code" ], "columnsTo": [ "code" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": { "seat_handover_offers_room_code_player_id_pk": { "columns": [ "room_code", "player_id" ], "name": "seat_handover_offers_room_code_player_id_pk" } }, "uniqueConstraints": {}, "checkConstraints": {} }, "seat_recovery_keys": { "name": "seat_recovery_keys", "columns": { "room_code": { "name": "room_code", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "player_id": { "name": "player_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "recovery_hash": { "name": "recovery_hash", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "current_operation_hash": { "name": "current_operation_hash", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false } }, "indexes": {}, "foreignKeys": { "seat_recovery_keys_room_code_rooms_code_fk": { "name": "seat_recovery_keys_room_code_rooms_code_fk", "tableFrom": "seat_recovery_keys", "tableTo": "rooms", "columnsFrom": [ "room_code" ], "columnsTo": [ "code" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": { "seat_recovery_keys_room_code_player_id_pk": { "columns": [ "room_code", "player_id" ], "name": "seat_recovery_keys_room_code_player_id_pk" } }, "uniqueConstraints": {}, "checkConstraints": {} }, "seat_recovery_receipts": { "name": "seat_recovery_receipts", "columns": { "room_code": { "name": "room_code", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "player_id": { "name": "player_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "operation_hash": { "name": "operation_hash", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "recovery_hash": { "name": "recovery_hash", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "session_hash": { "name": "session_hash", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": {}, "foreignKeys": { "seat_recovery_receipts_room_code_rooms_code_fk": { "name": "seat_recovery_receipts_room_code_rooms_code_fk", "tableFrom": "seat_recovery_receipts", "tableTo": "rooms", "columnsFrom": [ "room_code" ], "columnsTo": [ "code" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": { "seat_recovery_receipts_room_code_player_id_operation_hash_pk": { "columns": [ "room_code", "player_id", "operation_hash" ], "name": "seat_recovery_receipts_room_code_player_id_operation_hash_pk" } }, "uniqueConstraints": {}, "checkConstraints": {} }, "seats": { "name": "seats", "columns": { "token_hash": { "name": "token_hash", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "revoked": { "name": "revoked", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 0 }, "room_code": { "name": "room_code", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "player_id": { "name": "player_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": {}, "foreignKeys": { "seats_room_code_rooms_code_fk": { "name": "seats_room_code_rooms_code_fk", "tableFrom": "seats", "tableTo": "rooms", "columnsFrom": [ "room_code" ], "columnsTo": [ "code" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} } }, "views": {}, "enums": {}, "_meta": { "schemas": {}, "tables": {}, "columns": {} }, "internal": { "indexes": {} } }