From b0998224427594acda8e4e8419a945c20c062568 Mon Sep 17 00:00:00 2001 From: David Gay Date: Thu, 20 May 2021 18:39:20 -0400 Subject: Implement learned activities --- db/migrate/20210520222335_create_learned_activities.rb | 12 ++++++++++++ db/schema.rb | 14 +++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20210520222335_create_learned_activities.rb (limited to 'db') diff --git a/db/migrate/20210520222335_create_learned_activities.rb b/db/migrate/20210520222335_create_learned_activities.rb new file mode 100644 index 0000000..55d76f1 --- /dev/null +++ b/db/migrate/20210520222335_create_learned_activities.rb @@ -0,0 +1,12 @@ +class CreateLearnedActivities < ActiveRecord::Migration[6.1] + def change + create_table :learned_activities do |t| + t.references :character, null: false, foreign_key: true + t.references :activity, null: false, foreign_key: true + + t.timestamps + end + + add_column :activities, :innate, :boolean + end +end diff --git a/db/schema.rb b/db/schema.rb index ee68bb9..562eacf 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_05_20_014637) do +ActiveRecord::Schema.define(version: 2021_05_20_222335) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -23,6 +23,7 @@ ActiveRecord::Schema.define(version: 2021_05_20_014637) do t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false t.bigint "location_id" + t.boolean "innate" t.index ["gid"], name: "index_activities_on_gid" t.index ["location_id"], name: "index_activities_on_location_id" end @@ -118,6 +119,15 @@ ActiveRecord::Schema.define(version: 2021_05_20_014637) do t.index ["gid"], name: "index_items_on_gid" end + create_table "learned_activities", force: :cascade do |t| + t.bigint "character_id", null: false + t.bigint "activity_id", null: false + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["activity_id"], name: "index_learned_activities_on_activity_id" + t.index ["character_id"], name: "index_learned_activities_on_character_id" + end + create_table "locations", force: :cascade do |t| t.string "gid" t.string "name" @@ -178,5 +188,7 @@ ActiveRecord::Schema.define(version: 2021_05_20_014637) do add_foreign_key "chat_messages", "characters", column: "target_id" add_foreign_key "chat_messages", "chat_rooms" add_foreign_key "hearths", "characters" + add_foreign_key "learned_activities", "activities" + add_foreign_key "learned_activities", "characters" add_foreign_key "users", "characters", column: "active_character_id" end -- cgit v1.2.3