Skip to content

Commit

Permalink
🧹Furniture: And rename the database!
Browse files Browse the repository at this point in the history
  • Loading branch information
zspencer committed Mar 11, 2023
1 parent 6c620a3 commit a303942
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 0 additions & 2 deletions app/models/furniture.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
# as JSON, so that {Furniture} can be tweaked and configured as appropriate for
# it's particular use case.
class Furniture < ApplicationRecord
self.table_name = "furniture_placements"

include RankedModel
include WithinLocation
self.location_parent = :room
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class RenameFromFurniturePlacementsToFurnitures < ActiveRecord::Migration[7.0]
def change
rename_table :furniture_placements, :furnitures
end
end
12 changes: 6 additions & 6 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2023_03_10_214954) do
ActiveRecord::Schema[7.0].define(version: 2023_03_11_011858) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
enable_extension "plpgsql"
Expand Down Expand Up @@ -83,14 +83,14 @@
t.index ["sluggable_type", "sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_type_and_sluggable_id"
end

create_table "furniture_placements", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
create_table "furnitures", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.integer "slot"
t.string "furniture_kind"
t.jsonb "settings"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.uuid "room_id"
t.index ["room_id"], name: "index_furniture_placements_on_room_id"
t.index ["room_id"], name: "index_furnitures_on_room_id"
end

create_table "invitations", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
Expand Down Expand Up @@ -235,15 +235,15 @@

add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
add_foreign_key "journal_entries", "furniture_placements", column: "journal_id"
add_foreign_key "journal_entries", "furnitures", column: "journal_id"
add_foreign_key "marketplace_cart_products", "marketplace_orders", column: "cart_id"
add_foreign_key "marketplace_cart_products", "marketplace_products", column: "product_id"
add_foreign_key "marketplace_orders", "marketplace_shoppers", column: "shopper_id"
add_foreign_key "marketplace_product_tax_rates", "marketplace_products", column: "product_id"
add_foreign_key "marketplace_product_tax_rates", "marketplace_tax_rates", column: "tax_rate_id"
add_foreign_key "marketplace_products", "furniture_placements", column: "marketplace_id"
add_foreign_key "marketplace_products", "furnitures", column: "marketplace_id"
add_foreign_key "marketplace_shoppers", "people"
add_foreign_key "marketplace_tax_rates", "furniture_placements", column: "marketplace_id"
add_foreign_key "marketplace_tax_rates", "furnitures", column: "marketplace_id"
add_foreign_key "memberships", "invitations"
add_foreign_key "spaces", "rooms", column: "entrance_id"
end

0 comments on commit a303942

Please sign in to comment.