From cc2065299d18242a9c7a91a6134076e21fc852d0 Mon Sep 17 00:00:00 2001 From: Wanjohi Date: Sun, 11 May 2025 05:03:57 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9C=20fix(db):=20Add=20partial=20contr?= =?UTF-8?q?oller=5Fsupport?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/migrations/0015_handy_giant_man.sql | 1 + .../core/migrations/meta/0015_snapshot.json | 1266 +++++++++++++++++ packages/core/migrations/meta/_journal.json | 7 + packages/core/src/base-game/base-game.sql.ts | 2 +- packages/core/src/base-game/index.ts | 2 +- packages/zero/schema.ts | 2 +- 6 files changed, 1277 insertions(+), 3 deletions(-) create mode 100644 packages/core/migrations/0015_handy_giant_man.sql create mode 100644 packages/core/migrations/meta/0015_snapshot.json diff --git a/packages/core/migrations/0015_handy_giant_man.sql b/packages/core/migrations/0015_handy_giant_man.sql new file mode 100644 index 00000000..1536ed59 --- /dev/null +++ b/packages/core/migrations/0015_handy_giant_man.sql @@ -0,0 +1 @@ +ALTER TYPE "public"."controller_support" ADD VALUE 'partial' BEFORE 'unknown'; \ No newline at end of file diff --git a/packages/core/migrations/meta/0015_snapshot.json b/packages/core/migrations/meta/0015_snapshot.json new file mode 100644 index 00000000..93026629 --- /dev/null +++ b/packages/core/migrations/meta/0015_snapshot.json @@ -0,0 +1,1266 @@ +{ + "id": "4a4314df-d580-41fd-b042-c9d5aa6b5e32", + "prevId": "2b8ac73f-3308-4f80-b410-4b3192af6d67", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.base_games": { + "name": "base_games", + "schema": "", + "columns": { + "time_created": { + "name": "time_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "varchar(255)", + "primaryKey": true, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "release_date": { + "name": "release_date", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "size": { + "name": "size", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "primary_genre": { + "name": "primary_genre", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "controller_support": { + "name": "controller_support", + "type": "controller_support", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "compatibility": { + "name": "compatibility", + "type": "compatibility", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'unknown'" + }, + "score": { + "name": "score", + "type": "numeric(2, 1)", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "idx_base_games_slug": { + "name": "idx_base_games_slug", + "nullsNotDistinct": false, + "columns": [ + "slug" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.categories": { + "name": "categories", + "schema": "", + "columns": { + "time_created": { + "name": "time_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "slug": { + "name": "slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "category_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "idx_categories_type": { + "name": "idx_categories_type", + "columns": [ + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "categories_slug_type_pk": { + "name": "categories_slug_type_pk", + "columns": [ + "slug", + "type" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.steam_account_credentials": { + "name": "steam_account_credentials", + "schema": "", + "columns": { + "time_created": { + "name": "time_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "steam_id": { + "name": "steam_id", + "type": "varchar(255)", + "primaryKey": true, + "notNull": true + }, + "refresh_token": { + "name": "refresh_token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expiry": { + "name": "expiry", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "username": { + "name": "username", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "steam_account_credentials_steam_id_steam_accounts_id_fk": { + "name": "steam_account_credentials_steam_id_steam_accounts_id_fk", + "tableFrom": "steam_account_credentials", + "tableTo": "steam_accounts", + "columnsFrom": [ + "steam_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.friends_list": { + "name": "friends_list", + "schema": "", + "columns": { + "time_created": { + "name": "time_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "steam_id": { + "name": "steam_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "friend_steam_id": { + "name": "friend_steam_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "idx_friends_list_friend_steam_id": { + "name": "idx_friends_list_friend_steam_id", + "columns": [ + { + "expression": "friend_steam_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "friends_list_steam_id_steam_accounts_id_fk": { + "name": "friends_list_steam_id_steam_accounts_id_fk", + "tableFrom": "friends_list", + "tableTo": "steam_accounts", + "columnsFrom": [ + "steam_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "friends_list_friend_steam_id_steam_accounts_id_fk": { + "name": "friends_list_friend_steam_id_steam_accounts_id_fk", + "tableFrom": "friends_list", + "tableTo": "steam_accounts", + "columnsFrom": [ + "friend_steam_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "friends_list_steam_id_friend_steam_id_pk": { + "name": "friends_list_steam_id_friend_steam_id_pk", + "columns": [ + "steam_id", + "friend_steam_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.games": { + "name": "games", + "schema": "", + "columns": { + "time_created": { + "name": "time_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "base_game_id": { + "name": "base_game_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "category_slug": { + "name": "category_slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "category_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "idx_games_category_slug": { + "name": "idx_games_category_slug", + "columns": [ + { + "expression": "category_slug", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_games_category_type": { + "name": "idx_games_category_type", + "columns": [ + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_games_category_slug_type": { + "name": "idx_games_category_slug_type", + "columns": [ + { + "expression": "category_slug", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "games_base_game_id_base_games_id_fk": { + "name": "games_base_game_id_base_games_id_fk", + "tableFrom": "games", + "tableTo": "base_games", + "columnsFrom": [ + "base_game_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "games_categories_fkey": { + "name": "games_categories_fkey", + "tableFrom": "games", + "tableTo": "categories", + "columnsFrom": [ + "category_slug", + "type" + ], + "columnsTo": [ + "slug", + "type" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "games_base_game_id_category_slug_type_pk": { + "name": "games_base_game_id_category_slug_type_pk", + "columns": [ + "base_game_id", + "category_slug", + "type" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.images": { + "name": "images", + "schema": "", + "columns": { + "time_created": { + "name": "time_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "image_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "image_hash": { + "name": "image_hash", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "base_game_id": { + "name": "base_game_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "source_url": { + "name": "source_url", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "position": { + "name": "position", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "file_size": { + "name": "file_size", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "dimensions": { + "name": "dimensions", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "extracted_color": { + "name": "extracted_color", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "idx_images_type": { + "name": "idx_images_type", + "columns": [ + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_images_game_id": { + "name": "idx_images_game_id", + "columns": [ + { + "expression": "base_game_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "images_base_game_id_base_games_id_fk": { + "name": "images_base_game_id_base_games_id_fk", + "tableFrom": "images", + "tableTo": "base_games", + "columnsFrom": [ + "base_game_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "images_image_hash_type_base_game_id_position_pk": { + "name": "images_image_hash_type_base_game_id_position_pk", + "columns": [ + "image_hash", + "type", + "base_game_id", + "position" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.game_libraries": { + "name": "game_libraries", + "schema": "", + "columns": { + "time_created": { + "name": "time_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "base_game_id": { + "name": "base_game_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "owner_id": { + "name": "owner_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "idx_game_libraries_owner_id": { + "name": "idx_game_libraries_owner_id", + "columns": [ + { + "expression": "owner_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "game_libraries_base_game_id_base_games_id_fk": { + "name": "game_libraries_base_game_id_base_games_id_fk", + "tableFrom": "game_libraries", + "tableTo": "base_games", + "columnsFrom": [ + "base_game_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "game_libraries_owner_id_steam_accounts_id_fk": { + "name": "game_libraries_owner_id_steam_accounts_id_fk", + "tableFrom": "game_libraries", + "tableTo": "steam_accounts", + "columnsFrom": [ + "owner_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "game_libraries_base_game_id_owner_id_pk": { + "name": "game_libraries_base_game_id_owner_id_pk", + "columns": [ + "base_game_id", + "owner_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.members": { + "name": "members", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "char(30)", + "primaryKey": false, + "notNull": true + }, + "team_id": { + "name": "team_id", + "type": "char(30)", + "primaryKey": false, + "notNull": true + }, + "time_created": { + "name": "time_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "char(30)", + "primaryKey": false, + "notNull": false + }, + "steam_id": { + "name": "steam_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "member_role", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "idx_member_steam_id": { + "name": "idx_member_steam_id", + "columns": [ + { + "expression": "team_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "steam_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_member_user_id": { + "name": "idx_member_user_id", + "columns": [ + { + "expression": "team_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"members\".\"user_id\" is not null", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "members_user_id_users_id_fk": { + "name": "members_user_id_users_id_fk", + "tableFrom": "members", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "members_steam_id_steam_accounts_id_fk": { + "name": "members_steam_id_steam_accounts_id_fk", + "tableFrom": "members", + "tableTo": "steam_accounts", + "columnsFrom": [ + "steam_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "restrict" + } + }, + "compositePrimaryKeys": { + "members_id_team_id_pk": { + "name": "members_id_team_id_pk", + "columns": [ + "id", + "team_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.steam_accounts": { + "name": "steam_accounts", + "schema": "", + "columns": { + "time_created": { + "name": "time_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "varchar(255)", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "char(30)", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "steam_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "last_synced_at": { + "name": "last_synced_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "real_name": { + "name": "real_name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "member_since": { + "name": "member_since", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "profile_url": { + "name": "profile_url", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "username": { + "name": "username", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "avatar_hash": { + "name": "avatar_hash", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "limitations": { + "name": "limitations", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "steam_accounts_user_id_users_id_fk": { + "name": "steam_accounts_user_id_users_id_fk", + "tableFrom": "steam_accounts", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "idx_steam_username": { + "name": "idx_steam_username", + "nullsNotDistinct": false, + "columns": [ + "username" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.teams": { + "name": "teams", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "char(30)", + "primaryKey": true, + "notNull": true + }, + "time_created": { + "name": "time_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "owner_id": { + "name": "owner_id", + "type": "char(30)", + "primaryKey": false, + "notNull": true + }, + "invite_code": { + "name": "invite_code", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "max_members": { + "name": "max_members", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "idx_team_slug": { + "name": "idx_team_slug", + "columns": [ + { + "expression": "slug", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "teams_owner_id_users_id_fk": { + "name": "teams_owner_id_users_id_fk", + "tableFrom": "teams", + "tableTo": "users", + "columnsFrom": [ + "owner_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "teams_slug_steam_accounts_username_fk": { + "name": "teams_slug_steam_accounts_username_fk", + "tableFrom": "teams", + "tableTo": "steam_accounts", + "columnsFrom": [ + "slug" + ], + "columnsTo": [ + "username" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "idx_team_invite_code": { + "name": "idx_team_invite_code", + "nullsNotDistinct": false, + "columns": [ + "invite_code" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.users": { + "name": "users", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "char(30)", + "primaryKey": true, + "notNull": true + }, + "time_created": { + "name": "time_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "avatar_url": { + "name": "avatar_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "last_login": { + "name": "last_login", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "polar_customer_id": { + "name": "polar_customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "idx_user_email": { + "name": "idx_user_email", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.compatibility": { + "name": "compatibility", + "schema": "public", + "values": [ + "high", + "mid", + "low", + "unknown" + ] + }, + "public.controller_support": { + "name": "controller_support", + "schema": "public", + "values": [ + "full", + "partial", + "unknown" + ] + }, + "public.category_type": { + "name": "category_type", + "schema": "public", + "values": [ + "tag", + "genre", + "publisher", + "developer" + ] + }, + "public.image_type": { + "name": "image_type", + "schema": "public", + "values": [ + "heroArt", + "icon", + "logo", + "superHeroArt", + "poster", + "boxArt", + "screenshot", + "background" + ] + }, + "public.member_role": { + "name": "member_role", + "schema": "public", + "values": [ + "child", + "adult" + ] + }, + "public.steam_status": { + "name": "steam_status", + "schema": "public", + "values": [ + "online", + "offline", + "dnd", + "playing" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/packages/core/migrations/meta/_journal.json b/packages/core/migrations/meta/_journal.json index 22a43b6d..1bdb5222 100644 --- a/packages/core/migrations/meta/_journal.json +++ b/packages/core/migrations/meta/_journal.json @@ -106,6 +106,13 @@ "when": 1746926498096, "tag": "0014_thin_groot", "breakpoints": true + }, + { + "idx": 15, + "version": "7", + "when": 1746928882281, + "tag": "0015_handy_giant_man", + "breakpoints": true } ] } \ No newline at end of file diff --git a/packages/core/src/base-game/base-game.sql.ts b/packages/core/src/base-game/base-game.sql.ts index dcb8d869..284a8b76 100644 --- a/packages/core/src/base-game/base-game.sql.ts +++ b/packages/core/src/base-game/base-game.sql.ts @@ -3,7 +3,7 @@ import { timestamps, utc } from "../drizzle/types"; import { json, numeric, pgEnum, pgTable, text, unique, varchar } from "drizzle-orm/pg-core"; export const CompatibilityEnum = pgEnum("compatibility", ["high", "mid", "low", "unknown"]) -export const ControllerEnum = pgEnum("controller_support", ["full", "unknown"]) +export const ControllerEnum = pgEnum("controller_support", ["full","partial", "unknown"]) export const Size = z.object({ diff --git a/packages/core/src/base-game/index.ts b/packages/core/src/base-game/index.ts index 5111a953..5b8ba93f 100644 --- a/packages/core/src/base-game/index.ts +++ b/packages/core/src/base-game/index.ts @@ -41,7 +41,7 @@ export namespace BaseGame { example: Examples.BaseGame.primaryGenre }), controllerSupport: z.enum(ControllerEnum.enumValues).openapi({ - description: "Indicates the level of gamepad/controller compatibility: 'Full', 'Partial', or null for no support", + description: "Indicates the level of gamepad/controller compatibility: 'Full', 'Partial', or 'Unkown' for no support", example: Examples.BaseGame.controllerSupport }), compatibility: z.enum(CompatibilityEnum.enumValues).openapi({ diff --git a/packages/zero/schema.ts b/packages/zero/schema.ts index 7c3d75f5..1f77c96d 100644 --- a/packages/zero/schema.ts +++ b/packages/zero/schema.ts @@ -96,7 +96,7 @@ const base_games = table("base_games") size: json(), description: string(), primary_genre: string().optional(), - controller_support: enumeration<"full" | "unknown">(), + controller_support: enumeration<"full" | "partial" | "unknown">(), compatibility: enumeration<"high" | "mid" | "low" | "unknown">(), score: number(), ...timestamps