add Match model

This commit is contained in:
2026-11-03 16:14:10 +03:00
parent 1cadf00280
commit f48094cd55
6 changed files with 236 additions and 1 deletions
+25 -1
View File
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.1].define(version: 2026_10_05_000000) do
ActiveRecord::Schema[8.1].define(version: 2026_11_03_000000) do
create_table "active_storage_attachments", force: :cascade do |t|
t.bigint "blob_id", null: false
t.datetime "created_at", null: false
@@ -39,6 +39,28 @@ ActiveRecord::Schema[8.1].define(version: 2026_10_05_000000) do
t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
end
create_table "matches", force: :cascade do |t|
t.datetime "created_at", null: false
t.integer "duration_seconds"
t.datetime "finished_at"
t.text "game_server", null: false
t.integer "player1_id", null: false
t.integer "player1_rating_before", null: false
t.integer "player1_rating_change", default: 0, null: false
t.integer "player2_id", null: false
t.integer "player2_rating_before", null: false
t.integer "player2_rating_change", default: 0, null: false
t.datetime "started_at", null: false
t.integer "status", default: 0, null: false
t.datetime "updated_at", null: false
t.string "uuid", null: false
t.index ["player1_id", "finished_at"], name: "index_matches_on_player1_id_and_finished_at"
t.index ["player1_id"], name: "index_matches_on_player1_id"
t.index ["player2_id", "finished_at"], name: "index_matches_on_player2_id_and_finished_at"
t.index ["player2_id"], name: "index_matches_on_player2_id"
t.index ["uuid"], name: "index_matches_on_uuid", unique: true
end
create_table "sessions", force: :cascade do |t|
t.datetime "created_at", null: false
t.string "ip_address"
@@ -59,5 +81,7 @@ ActiveRecord::Schema[8.1].define(version: 2026_10_05_000000) do
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
add_foreign_key "matches", "users", column: "player1_id"
add_foreign_key "matches", "users", column: "player2_id"
add_foreign_key "sessions", "users"
end