|
12 | 12 |
|
13 | 13 | ActiveRecord::Schema[7.2].define(version: 2026_02_12_000000) do |
14 | 14 | create_schema "auth" |
| 15 | + create_schema "extensions" |
| 16 | + create_schema "graphql" |
| 17 | + create_schema "graphql_public" |
| 18 | + create_schema "pgbouncer" |
| 19 | + create_schema "realtime" |
| 20 | + create_schema "storage" |
| 21 | + create_schema "supabase_migrations" |
| 22 | + create_schema "vault" |
15 | 23 |
|
16 | 24 | # These are extensions that must be enabled in order to support this database |
| 25 | + enable_extension "pg_graphql" |
| 26 | + enable_extension "pg_stat_statements" |
17 | 27 | enable_extension "pgcrypto" |
18 | 28 | enable_extension "plpgsql" |
| 29 | + enable_extension "supabase_vault" |
| 30 | + enable_extension "uuid-ossp" |
19 | 31 |
|
20 | 32 | create_table "audit_logs", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| |
21 | 33 | t.uuid "organization_id", null: false |
|
166 | 178 | t.index ["match_type"], name: "index_matches_on_match_type" |
167 | 179 | t.index ["organization_id", "created_at"], name: "idx_matches_org_created" |
168 | 180 | t.index ["organization_id", "game_start", "victory"], name: "idx_matches_org_game_start_victory", comment: "Otimiza queries de winrate por período" |
| 181 | + t.index ["organization_id", "game_start"], name: "idx_matches_org_game_start" |
| 182 | + t.index ["organization_id", "victory"], name: "idx_matches_org_victory" |
169 | 183 | t.index ["organization_id"], name: "index_matches_on_organization_id" |
170 | 184 | t.index ["riot_match_id"], name: "index_matches_on_riot_match_id", unique: true |
171 | 185 | t.index ["victory"], name: "index_matches_on_victory" |
|
302 | 316 | t.datetime "updated_at", null: false |
303 | 317 | t.index ["champion"], name: "index_player_match_stats_on_champion" |
304 | 318 | t.index ["match_id", "player_id"], name: "idx_player_stats_match_player_agg", comment: "Otimiza agregações de estatísticas (SUM kills/deaths/assists)" |
| 319 | + t.index ["match_id"], name: "idx_player_stats_match" |
305 | 320 | t.index ["player_id", "match_id"], name: "index_player_match_stats_on_player_id_and_match_id", unique: true |
306 | 321 | t.index ["player_id"], name: "index_player_match_stats_on_player_id" |
307 | 322 | end |
|
365 | 380 | t.index ["organization_id", "deleted_at"], name: "idx_players_org_deleted_active", where: "(deleted_at IS NULL)", comment: "Índice parcial para COUNT de players ativos" |
366 | 381 | t.index ["organization_id", "last_sync_at"], name: "idx_players_org_last_sync" |
367 | 382 | t.index ["organization_id", "role"], name: "index_players_on_org_and_role" |
| 383 | + t.index ["organization_id", "status"], name: "idx_players_org_status" |
368 | 384 | t.index ["organization_id", "sync_status"], name: "idx_players_org_sync_status" |
369 | 385 | t.index ["organization_id"], name: "index_players_on_organization_id" |
370 | 386 | t.index ["player_access_enabled"], name: "index_players_on_player_access_enabled", comment: "Quick lookup for players with access enabled" |
|
403 | 419 | t.jsonb "metadata", default: {} |
404 | 420 | t.datetime "created_at", null: false |
405 | 421 | t.datetime "updated_at", null: false |
| 422 | + t.uuid "scrim_id" |
406 | 423 | t.index ["created_by_id"], name: "index_schedules_on_created_by_id" |
407 | 424 | t.index ["event_type"], name: "index_schedules_on_event_type" |
408 | 425 | t.index ["match_id"], name: "index_schedules_on_match_id" |
409 | 426 | t.index ["organization_id", "event_type"], name: "idx_schedules_org_event_type" |
410 | 427 | t.index ["organization_id", "start_time", "event_type"], name: "idx_schedules_org_time_type", comment: "Otimiza queries de próximos eventos" |
| 428 | + t.index ["organization_id", "start_time"], name: "idx_schedules_org_time" |
411 | 429 | t.index ["organization_id"], name: "index_schedules_on_organization_id" |
| 430 | + t.index ["scrim_id"], name: "index_schedules_on_scrim_id" |
412 | 431 | t.index ["start_time"], name: "index_schedules_on_start_time" |
413 | 432 | t.index ["status"], name: "index_schedules_on_status" |
414 | 433 | end |
|
634 | 653 | t.datetime "last_login_at", precision: nil |
635 | 654 | t.datetime "created_at", null: false |
636 | 655 | t.datetime "updated_at", null: false |
| 656 | + t.string "supabase_uid" |
637 | 657 | t.index ["email"], name: "index_users_on_email", unique: true |
638 | 658 | t.index ["organization_id"], name: "index_users_on_organization_id" |
639 | 659 | t.index ["role"], name: "index_users_on_role" |
| 660 | + t.index ["supabase_uid"], name: "index_users_on_supabase_uid" |
640 | 661 | end |
641 | 662 |
|
642 | 663 | create_table "vod_reviews", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| |
|
704 | 725 | add_foreign_key "players", "organizations", column: "previous_organization_id", on_delete: :nullify |
705 | 726 | add_foreign_key "schedules", "matches" |
706 | 727 | add_foreign_key "schedules", "organizations" |
| 728 | + add_foreign_key "schedules", "scrims", on_delete: :cascade |
707 | 729 | add_foreign_key "schedules", "users", column: "created_by_id" |
708 | 730 | add_foreign_key "scouting_watchlists", "organizations" |
709 | 731 | add_foreign_key "scouting_watchlists", "scouting_targets" |
|
0 commit comments