From 47ecf3f515ef5bd7db2c4f3bce0a872a46ca2233 Mon Sep 17 00:00:00 2001 From: David Gay Date: Fri, 3 Nov 2023 00:46:36 -0400 Subject: Adjust PokedexEntry to take a shiny boolean instead --- db/migrate/20231103011455_create_pokedex_entries.rb | 2 +- db/schema.rb | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'db') diff --git a/db/migrate/20231103011455_create_pokedex_entries.rb b/db/migrate/20231103011455_create_pokedex_entries.rb index 04232b1..aa75459 100644 --- a/db/migrate/20231103011455_create_pokedex_entries.rb +++ b/db/migrate/20231103011455_create_pokedex_entries.rb @@ -5,7 +5,7 @@ class CreatePokedexEntries < ActiveRecord::Migration[7.1] t.references :run, null: false, foreign_key: true t.references :pokemon, null: false, foreign_key: true t.timestamp :recorded_at, null: false - t.timestamp :recorded_shiny_at + t.boolean :shiny, null: false, default: false t.timestamps end diff --git a/db/schema.rb b/db/schema.rb index 0e65c84..3e64504 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.1].define(version: 2023_11_03_002142) do +ActiveRecord::Schema[7.1].define(version: 2023_11_03_011455) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -59,6 +59,19 @@ ActiveRecord::Schema[7.1].define(version: 2023_11_03_002142) do t.datetime "updated_at", null: false end + create_table "pokedex_entries", force: :cascade do |t| + t.bigint "user_id", null: false + t.bigint "run_id", null: false + t.bigint "pokemon_id", null: false + t.datetime "recorded_at", precision: nil, null: false + t.boolean "shiny", default: false, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["pokemon_id"], name: "index_pokedex_entries_on_pokemon_id" + t.index ["run_id"], name: "index_pokedex_entries_on_run_id" + t.index ["user_id"], name: "index_pokedex_entries_on_user_id" + end + create_table "pokemons", force: :cascade do |t| t.string "pokedex_num", null: false t.string "name", null: false @@ -91,6 +104,9 @@ ActiveRecord::Schema[7.1].define(version: 2023_11_03_002142) do add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id" add_foreign_key "checkpoints", "runs" add_foreign_key "checkpoints", "users" + add_foreign_key "pokedex_entries", "pokemons" + add_foreign_key "pokedex_entries", "runs" + add_foreign_key "pokedex_entries", "users" add_foreign_key "runs", "games" add_foreign_key "runs", "users" end -- cgit v1.2.3