Files
Dune/drizzle/meta/0013_snapshot.json
T
Quintine 98b1b3261b Add administrative room close and reopen controls
Preserve readable private tables, discussion and pending games while closure blocks new play, joins, messages, AI and seat mutations. Add live-authorized atomic closure audits, room-version/revision fences, dedicated controls and exact saved retries. Reopen with the saved pause/join settings and current credentials; restoring a removed but closed room keeps its AI stopped.

Verified types, lint, 5356 offline tests, 52 HTTP tests and build. Seventeen dedicated authenticated HTTP groups and independent privacy/persistence review passed. Desktop/mobile browser QA confirmed one close after a lost response and refresh, persistent readable notices, retained private draft, mobile reopening and saved-seat refresh. All 2,001 baseline rooms, 4,243 seats and related records preserved. Positive production admin acceptance awaits authorized QA access; full admin and rules gates remain open.
2026-09-22 12:31:02 +10:00

1707 lines
44 KiB
JSON

{
"version": "6",
"dialect": "sqlite",
"id": "1146c856-e30d-412c-b406-4f6ce66b9563",
"prevId": "0b688d88-eff4-438f-9596-8f079259da39",
"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_lobby_operations": {
"name": "admin_lobby_operations",
"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
},
"request_hash": {
"name": "request_hash",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"expected_version": {
"name": "expected_version",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"applied_version": {
"name": "applied_version",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"action": {
"name": "action",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"reason": {
"name": "reason",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"before_configuration": {
"name": "before_configuration",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"after_configuration": {
"name": "after_configuration",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"admin_lobby_operations_room": {
"name": "admin_lobby_operations_room",
"columns": [
"room_code",
"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_closures": {
"name": "admin_room_closures",
"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
},
"request_hash": {
"name": "request_hash",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"expected_version": {
"name": "expected_version",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"expected_revision": {
"name": "expected_revision",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"applied_version": {
"name": "applied_version",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"applied_revision": {
"name": "applied_revision",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"closed": {
"name": "closed",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"reason": {
"name": "reason",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"before_metadata": {
"name": "before_metadata",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"after_metadata": {
"name": "after_metadata",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"admin_room_closures_room": {
"name": "admin_room_closures_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_room_removals": {
"name": "admin_room_removals",
"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
},
"request_hash": {
"name": "request_hash",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"expected_version": {
"name": "expected_version",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"expected_revision": {
"name": "expected_revision",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"applied_version": {
"name": "applied_version",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"applied_revision": {
"name": "applied_revision",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"removed": {
"name": "removed",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"reason": {
"name": "reason",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"before_metadata": {
"name": "before_metadata",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"after_metadata": {
"name": "after_metadata",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"admin_room_removals_room": {
"name": "admin_room_removals_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_closures": {
"name": "room_closures",
"columns": {
"room_code": {
"name": "room_code",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"closed": {
"name": "closed",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"revision": {
"name": "revision",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"closed_at": {
"name": "closed_at",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"room_closures_room_code_rooms_code_fk": {
"name": "room_closures_room_code_rooms_code_fk",
"tableFrom": "room_closures",
"tableTo": "rooms",
"columnsFrom": [
"room_code"
],
"columnsTo": [
"code"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {
"room_closures_closed": {
"name": "room_closures_closed",
"value": "\"room_closures\".\"closed\" IN (0, 1)"
},
"room_closures_revision": {
"name": "room_closures_revision",
"value": "\"room_closures\".\"revision\" >= 0"
},
"room_closures_time": {
"name": "room_closures_time",
"value": "(\"room_closures\".\"closed\" = 1 AND \"room_closures\".\"closed_at\" IS NOT NULL) OR (\"room_closures\".\"closed\" = 0 AND \"room_closures\".\"closed_at\" IS NULL)"
}
}
},
"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": {}
},
"room_removals": {
"name": "room_removals",
"columns": {
"room_code": {
"name": "room_code",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"removed": {
"name": "removed",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"revision": {
"name": "revision",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"removed_at": {
"name": "removed_at",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"room_removals_room_code_rooms_code_fk": {
"name": "room_removals_room_code_rooms_code_fk",
"tableFrom": "room_removals",
"tableTo": "rooms",
"columnsFrom": [
"room_code"
],
"columnsTo": [
"code"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {
"room_removals_removed": {
"name": "room_removals_removed",
"value": "\"room_removals\".\"removed\" IN (0, 1)"
},
"room_removals_revision": {
"name": "room_removals_revision",
"value": "\"room_removals\".\"revision\" >= 0"
},
"room_removals_time": {
"name": "room_removals_time",
"value": "(\"room_removals\".\"removed\" = 1 AND \"room_removals\".\"removed_at\" IS NOT NULL) OR (\"room_removals\".\"removed\" = 0 AND \"room_removals\".\"removed_at\" IS NULL)"
}
}
},
"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": {}
}
}