{ "id": "e8a22e4a-d8ea-4ccf-a64b-5e4fd9fdea92", "prevId": "85b1ffb1-0667-4aee-89aa-5d9daf642cbb", "version": "7", "dialect": "postgresql", "tables": { "public.accepted_contracts": { "name": "accepted_contracts", "schema": "", "columns": { "player_id": { "name": "player_id", "type": "text", "primaryKey": false, "notNull": true }, "contract_id": { "name": "contract_id", "type": "text", "primaryKey": false, "notNull": true }, "period_index": { "name": "period_index", "type": "integer", "primaryKey": false, "notNull": true }, "dispatch_id": { "name": "dispatch_id", "type": "text", "primaryKey": false, "notNull": true }, "accepted_at": { "name": "accepted_at", "type": "bigint", "primaryKey": false, "notNull": true } }, "indexes": {}, "foreignKeys": { "accepted_contracts_player_id_players_id_fk": { "name": "accepted_contracts_player_id_players_id_fk", "tableFrom": "accepted_contracts", "tableTo": "players", "columnsFrom": [ "player_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "accepted_contracts_dispatch_id_dispatches_id_fk": { "name": "accepted_contracts_dispatch_id_dispatches_id_fk", "tableFrom": "accepted_contracts", "tableTo": "dispatches", "columnsFrom": [ "dispatch_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": { "accepted_contracts_player_id_contract_id_pk": { "name": "accepted_contracts_player_id_contract_id_pk", "columns": [ "player_id", "contract_id" ] } }, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.bays": { "name": "bays", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "player_id": { "name": "player_id", "type": "text", "primaryKey": false, "notNull": true }, "location_id": { "name": "location_id", "type": "text", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", "type": "bigint", "primaryKey": false, "notNull": true } }, "indexes": { "bays_player_location_idx": { "name": "bays_player_location_idx", "columns": [ { "expression": "player_id", "isExpression": false, "asc": true, "nulls": "last" }, { "expression": "location_id", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": true, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "bays_player_id_players_id_fk": { "name": "bays_player_id_players_id_fk", "tableFrom": "bays", "tableTo": "players", "columnsFrom": [ "player_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.claimed_goals": { "name": "claimed_goals", "schema": "", "columns": { "player_id": { "name": "player_id", "type": "text", "primaryKey": false, "notNull": true }, "goal_id": { "name": "goal_id", "type": "text", "primaryKey": false, "notNull": true }, "claimed_at": { "name": "claimed_at", "type": "bigint", "primaryKey": false, "notNull": true } }, "indexes": {}, "foreignKeys": { "claimed_goals_player_id_players_id_fk": { "name": "claimed_goals_player_id_players_id_fk", "tableFrom": "claimed_goals", "tableTo": "players", "columnsFrom": [ "player_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": { "claimed_goals_player_id_goal_id_pk": { "name": "claimed_goals_player_id_goal_id_pk", "columns": [ "player_id", "goal_id" ] } }, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.companies": { "name": "companies", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "player_id": { "name": "player_id", "type": "text", "primaryKey": false, "notNull": true }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true }, "credits": { "name": "credits", "type": "bigint", "primaryKey": false, "notNull": true }, "loan_balance": { "name": "loan_balance", "type": "bigint", "primaryKey": false, "notNull": true, "default": 0 } }, "indexes": {}, "foreignKeys": { "companies_player_id_players_id_fk": { "name": "companies_player_id_players_id_fk", "tableFrom": "companies", "tableTo": "players", "columnsFrom": [ "player_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "companies_player_id_unique": { "name": "companies_player_id_unique", "nullsNotDistinct": false, "columns": [ "player_id" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.contract_boards": { "name": "contract_boards", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "player_id": { "name": "player_id", "type": "text", "primaryKey": false, "notNull": true }, "kind": { "name": "kind", "type": "board_kind", "typeSchema": "public", "primaryKey": false, "notNull": true }, "location_id": { "name": "location_id", "type": "text", "primaryKey": false, "notNull": true }, "period_index": { "name": "period_index", "type": "integer", "primaryKey": false, "notNull": true }, "tutorial_run": { "name": "tutorial_run", "type": "integer", "primaryKey": false, "notNull": true, "default": 0 }, "contracts": { "name": "contracts", "type": "jsonb", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", "type": "bigint", "primaryKey": false, "notNull": true } }, "indexes": { "contract_boards_unique_idx": { "name": "contract_boards_unique_idx", "columns": [ { "expression": "player_id", "isExpression": false, "asc": true, "nulls": "last" }, { "expression": "kind", "isExpression": false, "asc": true, "nulls": "last" }, { "expression": "location_id", "isExpression": false, "asc": true, "nulls": "last" }, { "expression": "period_index", "isExpression": false, "asc": true, "nulls": "last" }, { "expression": "tutorial_run", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": true, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "contract_boards_player_id_players_id_fk": { "name": "contract_boards_player_id_players_id_fk", "tableFrom": "contract_boards", "tableTo": "players", "columnsFrom": [ "player_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.discovered_locations": { "name": "discovered_locations", "schema": "", "columns": { "player_id": { "name": "player_id", "type": "text", "primaryKey": false, "notNull": true }, "location_id": { "name": "location_id", "type": "text", "primaryKey": false, "notNull": true }, "discovered_at": { "name": "discovered_at", "type": "bigint", "primaryKey": false, "notNull": true } }, "indexes": {}, "foreignKeys": { "discovered_locations_player_id_players_id_fk": { "name": "discovered_locations_player_id_players_id_fk", "tableFrom": "discovered_locations", "tableTo": "players", "columnsFrom": [ "player_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": { "discovered_locations_player_id_location_id_pk": { "name": "discovered_locations_player_id_location_id_pk", "columns": [ "player_id", "location_id" ] } }, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.dispatches": { "name": "dispatches", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "player_id": { "name": "player_id", "type": "text", "primaryKey": false, "notNull": true }, "ship_id": { "name": "ship_id", "type": "text", "primaryKey": false, "notNull": false }, "pilot_id": { "name": "pilot_id", "type": "text", "primaryKey": false, "notNull": true }, "tutorial": { "name": "tutorial", "type": "boolean", "primaryKey": false, "notNull": true }, "record": { "name": "record", "type": "jsonb", "primaryKey": false, "notNull": true }, "arrival_at": { "name": "arrival_at", "type": "bigint", "primaryKey": false, "notNull": true }, "status": { "name": "status", "type": "dispatch_status", "typeSchema": "public", "primaryKey": false, "notNull": true, "default": "'in_flight'" }, "resolution": { "name": "resolution", "type": "jsonb", "primaryKey": false, "notNull": false }, "resolved_at": { "name": "resolved_at", "type": "bigint", "primaryKey": false, "notNull": false }, "acknowledged_at": { "name": "acknowledged_at", "type": "bigint", "primaryKey": false, "notNull": false } }, "indexes": { "dispatches_due_idx": { "name": "dispatches_due_idx", "columns": [ { "expression": "status", "isExpression": false, "asc": true, "nulls": "last" }, { "expression": "arrival_at", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} }, "dispatches_player_status_idx": { "name": "dispatches_player_status_idx", "columns": [ { "expression": "player_id", "isExpression": false, "asc": true, "nulls": "last" }, { "expression": "status", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "dispatches_player_id_players_id_fk": { "name": "dispatches_player_id_players_id_fk", "tableFrom": "dispatches", "tableTo": "players", "columnsFrom": [ "player_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "dispatches_ship_id_ships_id_fk": { "name": "dispatches_ship_id_ships_id_fk", "tableFrom": "dispatches", "tableTo": "ships", "columnsFrom": [ "ship_id" ], "columnsTo": [ "id" ], "onDelete": "set null", "onUpdate": "no action" }, "dispatches_pilot_id_pilots_id_fk": { "name": "dispatches_pilot_id_pilots_id_fk", "tableFrom": "dispatches", "tableTo": "pilots", "columnsFrom": [ "pilot_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.pilots": { "name": "pilots", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "player_id": { "name": "player_id", "type": "text", "primaryKey": false, "notNull": true }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true }, "is_avatar": { "name": "is_avatar", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, "xp": { "name": "xp", "type": "integer", "primaryKey": false, "notNull": true, "default": 0 }, "skills": { "name": "skills", "type": "jsonb", "primaryKey": false, "notNull": true, "default": "'{}'::jsonb" }, "skill_points_spent": { "name": "skill_points_spent", "type": "integer", "primaryKey": false, "notNull": true, "default": 0 }, "assigned_ship_id": { "name": "assigned_ship_id", "type": "text", "primaryKey": false, "notNull": false }, "location_id": { "name": "location_id", "type": "text", "primaryKey": false, "notNull": false }, "status": { "name": "status", "type": "activity_status", "typeSchema": "public", "primaryKey": false, "notNull": true, "default": "'idle'" }, "duty_hours": { "name": "duty_hours", "type": "double precision", "primaryKey": false, "notNull": true, "default": 0 }, "rest_ends_at": { "name": "rest_ends_at", "type": "bigint", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "bigint", "primaryKey": false, "notNull": true } }, "indexes": { "pilots_player_idx": { "name": "pilots_player_idx", "columns": [ { "expression": "player_id", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "pilots_player_id_players_id_fk": { "name": "pilots_player_id_players_id_fk", "tableFrom": "pilots", "tableTo": "players", "columnsFrom": [ "player_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "pilots_assigned_ship_id_ships_id_fk": { "name": "pilots_assigned_ship_id_ships_id_fk", "tableFrom": "pilots", "tableTo": "ships", "columnsFrom": [ "assigned_ship_id" ], "columnsTo": [ "id" ], "onDelete": "set null", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "pilots_assigned_ship_id_unique": { "name": "pilots_assigned_ship_id_unique", "nullsNotDistinct": false, "columns": [ "assigned_ship_id" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.players": { "name": "players", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": true }, "world_seed": { "name": "world_seed", "type": "bigint", "primaryKey": false, "notNull": true }, "tutorial_active": { "name": "tutorial_active", "type": "boolean", "primaryKey": false, "notNull": true, "default": true }, "loaner_location_id": { "name": "loaner_location_id", "type": "text", "primaryKey": false, "notNull": false }, "tutorial_runs_completed": { "name": "tutorial_runs_completed", "type": "integer", "primaryKey": false, "notNull": true, "default": 0 }, "deal_accepted": { "name": "deal_accepted", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, "created_at": { "name": "created_at", "type": "bigint", "primaryKey": false, "notNull": true } }, "indexes": {}, "foreignKeys": { "players_user_id_user_id_fk": { "name": "players_user_id_user_id_fk", "tableFrom": "players", "tableTo": "user", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "players_user_id_unique": { "name": "players_user_id_unique", "nullsNotDistinct": false, "columns": [ "user_id" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.ships": { "name": "ships", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "player_id": { "name": "player_id", "type": "text", "primaryKey": false, "notNull": true }, "model_id": { "name": "model_id", "type": "text", "primaryKey": false, "notNull": true }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true }, "status": { "name": "status", "type": "activity_status", "typeSchema": "public", "primaryKey": false, "notNull": true, "default": "'idle'" }, "location_id": { "name": "location_id", "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "bigint", "primaryKey": false, "notNull": true } }, "indexes": { "ships_player_idx": { "name": "ships_player_idx", "columns": [ { "expression": "player_id", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "ships_player_id_players_id_fk": { "name": "ships_player_id_players_id_fk", "tableFrom": "ships", "tableTo": "players", "columnsFrom": [ "player_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.account": { "name": "account", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "account_id": { "name": "account_id", "type": "text", "primaryKey": false, "notNull": true }, "provider_id": { "name": "provider_id", "type": "text", "primaryKey": false, "notNull": true }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": true }, "access_token": { "name": "access_token", "type": "text", "primaryKey": false, "notNull": false }, "refresh_token": { "name": "refresh_token", "type": "text", "primaryKey": false, "notNull": false }, "id_token": { "name": "id_token", "type": "text", "primaryKey": false, "notNull": false }, "access_token_expires_at": { "name": "access_token_expires_at", "type": "timestamp", "primaryKey": false, "notNull": false }, "refresh_token_expires_at": { "name": "refresh_token_expires_at", "type": "timestamp", "primaryKey": false, "notNull": false }, "scope": { "name": "scope", "type": "text", "primaryKey": false, "notNull": false }, "password": { "name": "password", "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": true } }, "indexes": { "account_userId_idx": { "name": "account_userId_idx", "columns": [ { "expression": "user_id", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "account_user_id_user_id_fk": { "name": "account_user_id_user_id_fk", "tableFrom": "account", "tableTo": "user", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.session": { "name": "session", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "expires_at": { "name": "expires_at", "type": "timestamp", "primaryKey": false, "notNull": true }, "token": { "name": "token", "type": "text", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": true }, "ip_address": { "name": "ip_address", "type": "text", "primaryKey": false, "notNull": false }, "user_agent": { "name": "user_agent", "type": "text", "primaryKey": false, "notNull": false }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": true } }, "indexes": { "session_userId_idx": { "name": "session_userId_idx", "columns": [ { "expression": "user_id", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "session_user_id_user_id_fk": { "name": "session_user_id_user_id_fk", "tableFrom": "session", "tableTo": "user", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "session_token_unique": { "name": "session_token_unique", "nullsNotDistinct": false, "columns": [ "token" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.user": { "name": "user", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true }, "email": { "name": "email", "type": "text", "primaryKey": false, "notNull": true }, "email_verified": { "name": "email_verified", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, "image": { "name": "image", "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, "is_anonymous": { "name": "is_anonymous", "type": "boolean", "primaryKey": false, "notNull": false, "default": false } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { "user_email_unique": { "name": "user_email_unique", "nullsNotDistinct": false, "columns": [ "email" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.verification": { "name": "verification", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "identifier": { "name": "identifier", "type": "text", "primaryKey": false, "notNull": true }, "value": { "name": "value", "type": "text", "primaryKey": false, "notNull": true }, "expires_at": { "name": "expires_at", "type": "timestamp", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": { "verification_identifier_idx": { "name": "verification_identifier_idx", "columns": [ { "expression": "identifier", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false } }, "enums": { "public.activity_status": { "name": "activity_status", "schema": "public", "values": [ "idle", "in_flight" ] }, "public.board_kind": { "name": "board_kind", "schema": "public", "values": [ "location", "tutorial" ] }, "public.dispatch_status": { "name": "dispatch_status", "schema": "public", "values": [ "in_flight", "resolved" ] } }, "schemas": {}, "sequences": {}, "roles": {}, "policies": {}, "views": {}, "_meta": { "columns": {}, "schemas": {}, "tables": {} } }