diff options
author | David Gay <david@davidgay.org> | 2021-06-06 19:06:46 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-06-06 19:06:46 -0400 |
commit | e37402ff309311a14d7dd666d0d8b29517504017 (patch) | |
tree | 3d6604805e9004bc0c37130f451376e79a68c989 /db | |
parent | 3622126380278d9bed8ea0e1e05a0bd1ea040596 (diff) |
Leviathans
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20210606215806_create_monster_spawns.rb | 10 | ||||
-rw-r--r-- | db/migrate/20210606215818_create_monster_spawn_combats.rb | 11 | ||||
-rw-r--r-- | db/schema.rb | 25 |
3 files changed, 45 insertions, 1 deletions
diff --git a/db/migrate/20210606215806_create_monster_spawns.rb b/db/migrate/20210606215806_create_monster_spawns.rb new file mode 100644 index 0000000..96ccefe --- /dev/null +++ b/db/migrate/20210606215806_create_monster_spawns.rb @@ -0,0 +1,10 @@ +class CreateMonsterSpawns < ActiveRecord::Migration[6.1] + def change + create_table :monster_spawns do |t| + t.references :monster, null: false, foreign_key: true + t.references :location, null: false, foreign_key: true + + t.timestamps + end + end +end diff --git a/db/migrate/20210606215818_create_monster_spawn_combats.rb b/db/migrate/20210606215818_create_monster_spawn_combats.rb new file mode 100644 index 0000000..a2dd894 --- /dev/null +++ b/db/migrate/20210606215818_create_monster_spawn_combats.rb @@ -0,0 +1,11 @@ +class CreateMonsterSpawnCombats < ActiveRecord::Migration[6.1] + def change + create_table :monster_spawn_combats do |t| + t.references :monster_spawn, null: false, foreign_key: true + t.references :character, null: false, foreign_key: true + t.integer :hp_lost + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 55a66d9..6e34c95 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.define(version: 2021_06_06_214340) do +ActiveRecord::Schema.define(version: 2021_06_06_215818) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -196,6 +196,25 @@ ActiveRecord::Schema.define(version: 2021_06_06_214340) do t.index ["sender_id"], name: "index_messages_on_sender_id" end + create_table "monster_spawn_combats", force: :cascade do |t| + t.bigint "monster_spawn_id", null: false + t.bigint "character_id", null: false + t.integer "hp_lost" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["character_id"], name: "index_monster_spawn_combats_on_character_id" + t.index ["monster_spawn_id"], name: "index_monster_spawn_combats_on_monster_spawn_id" + end + + create_table "monster_spawns", force: :cascade do |t| + t.bigint "monster_id", null: false + t.bigint "location_id", null: false + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["location_id"], name: "index_monster_spawns_on_location_id" + t.index ["monster_id"], name: "index_monster_spawns_on_monster_id" + end + create_table "monsters", force: :cascade do |t| t.string "gid" t.string "name" @@ -292,6 +311,10 @@ ActiveRecord::Schema.define(version: 2021_06_06_214340) do add_foreign_key "learned_activities", "characters" add_foreign_key "messages", "characters", column: "recipient_id" add_foreign_key "messages", "characters", column: "sender_id" + add_foreign_key "monster_spawn_combats", "characters" + add_foreign_key "monster_spawn_combats", "monster_spawns" + add_foreign_key "monster_spawns", "locations" + add_foreign_key "monster_spawns", "monsters" add_foreign_key "states", "characters" add_foreign_key "states", "conditions" add_foreign_key "title_awards", "characters" |