This commit is contained in:
2025-03-11 09:52:32 -07:00
parent 0e380931b1
commit 97d5bd9ace
18 changed files with 294 additions and 61 deletions

View File

@ -0,0 +1,13 @@
class CreateLoots < ActiveRecord::Migration[8.0]
def change
create_table :loots do |t|
t.integer :item_id
t.datetime :timestamp
t.string :item_name
t.string :roll_type
t.references :player, null: false, foreign_key: true
t.timestamps
end
end
end

15
db/schema.rb generated
View File

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.0].define(version: 2025_02_27_233421) do
ActiveRecord::Schema[8.0].define(version: 2025_03_10_212905) do
create_table "api_keys", force: :cascade do |t|
t.string "key"
t.string "client"
@ -38,6 +38,17 @@ ActiveRecord::Schema[8.0].define(version: 2025_02_27_233421) do
t.datetime "updated_at", null: false
end
create_table "loots", force: :cascade do |t|
t.integer "item_id"
t.datetime "timestamp"
t.string "item_name"
t.string "roll_type"
t.integer "player_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["player_id"], name: "index_loots_on_player_id"
end
create_table "players", force: :cascade do |t|
t.string "name"
t.integer "wins"
@ -48,4 +59,6 @@ ActiveRecord::Schema[8.0].define(version: 2025_02_27_233421) do
t.integer "main_player_id"
t.index ["main_player_id"], name: "index_players_on_main_player_id"
end
add_foreign_key "loots", "players"
end

1
db/seeds.rb Normal file
View File

@ -0,0 +1 @@
ApiKey.create(client: "test", key: "12345")