add favorite flag to all content pages

This commit is contained in:
Andrew Brown 2020-01-28 11:09:46 -06:00
parent ee1eec9c19
commit 75d178de59
3 changed files with 57 additions and 5 deletions

View File

@ -1,5 +0,0 @@
class AddFavoriteFlagToCharacters < ActiveRecord::Migration[6.0]
def change
add_column :characters, :favorite, :boolean
end
end

View File

@ -0,0 +1,31 @@
class AddFavoriteFlagToContentPages < ActiveRecord::Migration[6.0]
def change
add_column :universes, :favorite, :boolean
add_column :characters, :favorite, :boolean
add_column :locations, :favorite, :boolean
add_column :items, :favorite, :boolean
add_column :buildings, :favorite, :boolean
add_column :conditions, :favorite, :boolean
add_column :countries, :favorite, :boolean
add_column :creatures, :favorite, :boolean
add_column :deities, :favorite, :boolean
add_column :floras, :favorite, :boolean
add_column :foods, :favorite, :boolean
add_column :governments, :favorite, :boolean
add_column :groups, :favorite, :boolean
add_column :jobs, :favorite, :boolean
add_column :landmarks, :favorite, :boolean
add_column :languages, :favorite, :boolean
add_column :magics, :favorite, :boolean
add_column :planets, :favorite, :boolean
add_column :races, :favorite, :boolean
add_column :religions, :favorite, :boolean
add_column :scenes, :favorite, :boolean
add_column :schools, :favorite, :boolean
add_column :sports, :favorite, :boolean
add_column :technologies, :favorite, :boolean
add_column :towns, :favorite, :boolean
add_column :traditions, :favorite, :boolean
add_column :vehicles, :favorite, :boolean
end
end

View File

@ -184,6 +184,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "archived_at"
t.boolean "favorite"
t.index ["universe_id"], name: "index_buildings_on_universe_id"
t.index ["user_id", "universe_id", "deleted_at"], name: "index_buildings_on_user_id_and_universe_id_and_deleted_at"
t.index ["user_id"], name: "index_buildings_on_user_id"
@ -363,6 +364,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "archived_at"
t.boolean "favorite"
t.index ["universe_id"], name: "index_conditions_on_universe_id"
t.index ["user_id", "universe_id", "deleted_at"], name: "index_conditions_on_user_id_and_universe_id_and_deleted_at"
t.index ["user_id"], name: "index_conditions_on_user_id"
@ -429,6 +431,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.integer "user_id"
t.string "page_type", default: "Country"
t.datetime "archived_at"
t.boolean "favorite"
t.index ["deleted_at", "id"], name: "index_countries_on_deleted_at_and_id"
t.index ["deleted_at", "universe_id"], name: "index_countries_on_deleted_at_and_universe_id"
t.index ["deleted_at", "user_id"], name: "index_countries_on_deleted_at_and_user_id"
@ -575,6 +578,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.string "species"
t.string "page_type", default: "Creature"
t.datetime "archived_at"
t.boolean "favorite"
t.index ["deleted_at", "id"], name: "index_creatures_on_deleted_at_and_id"
t.index ["deleted_at", "universe_id"], name: "index_creatures_on_deleted_at_and_universe_id"
t.index ["deleted_at", "user_id"], name: "index_creatures_on_deleted_at_and_user_id"
@ -618,6 +622,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.datetime "updated_at", null: false
t.string "page_type", default: "Deity"
t.datetime "archived_at"
t.boolean "favorite"
t.index ["deleted_at", "id"], name: "index_deities_on_deleted_at_and_id"
t.index ["deleted_at", "universe_id"], name: "index_deities_on_deleted_at_and_universe_id"
t.index ["deleted_at", "user_id"], name: "index_deities_on_deleted_at_and_user_id"
@ -986,6 +991,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.string "material_uses"
t.string "page_type", default: "Flora"
t.datetime "archived_at"
t.boolean "favorite"
t.index ["deleted_at", "id"], name: "index_floras_on_deleted_at_and_id"
t.index ["deleted_at", "universe_id"], name: "index_floras_on_deleted_at_and_universe_id"
t.index ["deleted_at", "user_id"], name: "index_floras_on_deleted_at_and_user_id"
@ -1006,6 +1012,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "archived_at"
t.boolean "favorite"
t.index ["universe_id"], name: "index_foods_on_universe_id"
t.index ["user_id", "universe_id", "deleted_at"], name: "index_foods_on_user_id_and_universe_id_and_deleted_at"
t.index ["user_id"], name: "index_foods_on_user_id"
@ -1123,6 +1130,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.datetime "updated_at", null: false
t.string "page_type", default: "Government"
t.datetime "archived_at"
t.boolean "favorite"
t.index ["deleted_at", "id"], name: "index_governments_on_deleted_at_and_id"
t.index ["deleted_at", "universe_id"], name: "index_governments_on_deleted_at_and_universe_id"
t.index ["deleted_at", "user_id"], name: "index_governments_on_deleted_at_and_user_id"
@ -1217,6 +1225,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.datetime "deleted_at"
t.string "page_type", default: "Group"
t.datetime "archived_at"
t.boolean "favorite"
t.index ["deleted_at", "id"], name: "index_groups_on_deleted_at_and_id"
t.index ["deleted_at", "universe_id"], name: "index_groups_on_deleted_at_and_universe_id"
t.index ["deleted_at", "user_id"], name: "index_groups_on_deleted_at_and_user_id"
@ -1280,6 +1289,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.datetime "deleted_at"
t.string "page_type", default: "Item"
t.datetime "archived_at"
t.boolean "favorite"
t.index ["deleted_at", "id"], name: "index_items_on_deleted_at_and_id"
t.index ["deleted_at", "universe_id"], name: "index_items_on_deleted_at_and_universe_id"
t.index ["deleted_at", "user_id"], name: "index_items_on_deleted_at_and_user_id"
@ -1300,6 +1310,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "archived_at"
t.boolean "favorite"
t.index ["universe_id"], name: "index_jobs_on_universe_id"
t.index ["user_id", "universe_id", "deleted_at"], name: "index_jobs_on_user_id_and_universe_id_and_deleted_at"
t.index ["user_id"], name: "index_jobs_on_user_id"
@ -1373,6 +1384,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.integer "user_id"
t.string "page_type", default: "Landmark"
t.datetime "archived_at"
t.boolean "favorite"
t.index ["deleted_at", "id"], name: "index_landmarks_on_deleted_at_and_id"
t.index ["deleted_at", "universe_id"], name: "index_landmarks_on_deleted_at_and_universe_id"
t.index ["deleted_at", "user_id"], name: "index_landmarks_on_deleted_at_and_user_id"
@ -1403,6 +1415,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.datetime "deleted_at"
t.string "page_type", default: "Language"
t.datetime "archived_at"
t.boolean "favorite"
t.index ["deleted_at", "id"], name: "index_languages_on_deleted_at_and_id"
t.index ["deleted_at", "universe_id"], name: "index_languages_on_deleted_at_and_universe_id"
t.index ["deleted_at", "user_id"], name: "index_languages_on_deleted_at_and_user_id"
@ -1515,6 +1528,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.datetime "deleted_at"
t.string "page_type", default: "Location"
t.datetime "archived_at"
t.boolean "favorite"
t.index ["deleted_at", "id"], name: "index_locations_on_deleted_at_and_id"
t.index ["deleted_at", "universe_id"], name: "index_locations_on_deleted_at_and_universe_id"
t.index ["deleted_at", "user_id"], name: "index_locations_on_deleted_at_and_user_id"
@ -1555,6 +1569,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.datetime "deleted_at"
t.string "page_type", default: "Magic"
t.datetime "archived_at"
t.boolean "favorite"
t.index ["deleted_at", "id"], name: "index_magics_on_deleted_at_and_id"
t.index ["deleted_at", "universe_id"], name: "index_magics_on_deleted_at_and_universe_id"
t.index ["deleted_at", "user_id"], name: "index_magics_on_deleted_at_and_user_id"
@ -1839,6 +1854,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.string "notes"
t.string "page_type", default: "Planet"
t.datetime "archived_at"
t.boolean "favorite"
t.index ["deleted_at", "id"], name: "index_planets_on_deleted_at_and_id"
t.index ["deleted_at", "universe_id"], name: "index_planets_on_deleted_at_and_universe_id"
t.index ["deleted_at", "user_id"], name: "index_planets_on_deleted_at_and_user_id"
@ -1891,6 +1907,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.datetime "deleted_at"
t.string "page_type", default: "Race"
t.datetime "archived_at"
t.boolean "favorite"
t.index ["deleted_at", "id"], name: "index_races_on_deleted_at_and_id"
t.index ["deleted_at", "universe_id"], name: "index_races_on_deleted_at_and_universe_id"
t.index ["deleted_at", "user_id"], name: "index_races_on_deleted_at_and_user_id"
@ -1963,6 +1980,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.datetime "deleted_at"
t.string "page_type", default: "Religion"
t.datetime "archived_at"
t.boolean "favorite"
t.index ["deleted_at", "id"], name: "index_religions_on_deleted_at_and_id"
t.index ["deleted_at", "universe_id"], name: "index_religions_on_deleted_at_and_universe_id"
t.index ["deleted_at", "user_id"], name: "index_religions_on_deleted_at_and_user_id"
@ -2027,6 +2045,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.datetime "deleted_at"
t.string "page_type", default: "Scene"
t.datetime "archived_at"
t.boolean "favorite"
t.index ["deleted_at", "id"], name: "index_scenes_on_deleted_at_and_id"
t.index ["deleted_at", "universe_id"], name: "index_scenes_on_deleted_at_and_universe_id"
t.index ["deleted_at", "user_id"], name: "index_scenes_on_deleted_at_and_user_id"
@ -2047,6 +2066,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "archived_at"
t.boolean "favorite"
t.index ["universe_id"], name: "index_schools_on_universe_id"
t.index ["user_id", "universe_id", "deleted_at"], name: "index_schools_on_user_id_and_universe_id_and_deleted_at"
t.index ["user_id"], name: "index_schools_on_user_id"
@ -2083,6 +2103,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "archived_at"
t.boolean "favorite"
t.index ["universe_id"], name: "index_sports_on_universe_id"
t.index ["user_id", "universe_id", "deleted_at"], name: "index_sports_on_user_id_and_universe_id_and_deleted_at"
t.index ["user_id"], name: "index_sports_on_user_id"
@ -2145,6 +2166,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.datetime "updated_at", null: false
t.string "page_type", default: "Technology"
t.datetime "archived_at"
t.boolean "favorite"
t.index ["deleted_at", "id"], name: "index_technologies_on_deleted_at_and_id"
t.index ["deleted_at", "universe_id"], name: "index_technologies_on_deleted_at_and_universe_id"
t.index ["deleted_at", "user_id"], name: "index_technologies_on_deleted_at_and_user_id"
@ -2582,6 +2604,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.integer "user_id"
t.string "page_type", default: "Town"
t.datetime "archived_at"
t.boolean "favorite"
t.index ["deleted_at", "id"], name: "index_towns_on_deleted_at_and_id"
t.index ["deleted_at", "universe_id"], name: "index_towns_on_deleted_at_and_universe_id"
t.index ["deleted_at", "user_id"], name: "index_towns_on_deleted_at_and_user_id"
@ -2601,6 +2624,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "archived_at"
t.boolean "favorite"
t.index ["universe_id"], name: "index_traditions_on_universe_id"
t.index ["user_id", "universe_id", "deleted_at"], name: "index_traditions_on_user_id_and_universe_id_and_deleted_at"
t.index ["user_id"], name: "index_traditions_on_user_id"
@ -2623,6 +2647,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.datetime "deleted_at"
t.string "page_type", default: "Universe"
t.datetime "archived_at"
t.boolean "favorite"
t.index "\"user_id\", \"universe_id\", \"deleted_at\"", name: "index_universes_on_user_id_and_universe_id_and_deleted_at"
t.index ["deleted_at", "id"], name: "index_universes_on_deleted_at_and_id"
t.index ["deleted_at", "user_id"], name: "index_universes_on_deleted_at_and_user_id"
@ -2699,6 +2724,7 @@ ActiveRecord::Schema.define(version: 2020_01_28_161646) do
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "archived_at"
t.boolean "favorite"
t.index ["universe_id"], name: "index_vehicles_on_universe_id"
t.index ["user_id", "universe_id", "deleted_at"], name: "index_vehicles_on_user_id_and_universe_id_and_deleted_at"
t.index ["user_id"], name: "index_vehicles_on_user_id"