loot
This commit is contained in:
13
db/migrate/20250310212905_create_loots.rb
Normal file
13
db/migrate/20250310212905_create_loots.rb
Normal 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
15
db/schema.rb
generated
@ -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
1
db/seeds.rb
Normal file
@ -0,0 +1 @@
|
||||
ApiKey.create(client: "test", key: "12345")
|
Reference in New Issue
Block a user