summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-05-23 17:06:34 -0400
committerDavid Gay <david@davidgay.org>2021-05-23 17:06:34 -0400
commitaba212e13062c43a1192ef885b05145ac1cc9fe7 (patch)
tree61e3850ec0c86913a7e2d42076bcd73aa59f480a /db
parent44facc2e567eb3c045ce082428f42276e45b0202 (diff)
Bazaar with buy orders, sell orders, and order cancellation
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20210523151747_create_bazaar_orders.rb13
-rw-r--r--db/schema.rb16
2 files changed, 28 insertions, 1 deletions
diff --git a/db/migrate/20210523151747_create_bazaar_orders.rb b/db/migrate/20210523151747_create_bazaar_orders.rb
new file mode 100644
index 0000000..24bded3
--- /dev/null
+++ b/db/migrate/20210523151747_create_bazaar_orders.rb
@@ -0,0 +1,13 @@
+class CreateBazaarOrders < ActiveRecord::Migration[6.1]
+ def change
+ create_table :bazaar_orders do |t|
+ t.references :character, null: false, foreign_key: true
+ t.references :item, null: false, foreign_key: true
+ t.integer :quantity
+ t.integer :price_each
+ t.boolean :buy_order
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 6dfbe87..2568430 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_22_201259) do
+ActiveRecord::Schema.define(version: 2021_05_23_151747) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -28,6 +28,18 @@ ActiveRecord::Schema.define(version: 2021_05_22_201259) do
t.index ["location_id"], name: "index_activities_on_location_id"
end
+ create_table "bazaar_orders", force: :cascade do |t|
+ t.bigint "character_id", null: false
+ t.bigint "item_id", null: false
+ t.integer "quantity"
+ t.integer "price_each"
+ t.boolean "buy_order"
+ t.datetime "created_at", precision: 6, null: false
+ t.datetime "updated_at", precision: 6, null: false
+ t.index ["character_id"], name: "index_bazaar_orders_on_character_id"
+ t.index ["item_id"], name: "index_bazaar_orders_on_item_id"
+ end
+
create_table "built_hearth_amenities", force: :cascade do |t|
t.bigint "hearth_id", null: false
t.bigint "hearth_amenity_id", null: false
@@ -213,6 +225,8 @@ ActiveRecord::Schema.define(version: 2021_05_22_201259) do
t.index ["unlock_token"], name: "index_users_on_unlock_token", unique: true
end
+ add_foreign_key "bazaar_orders", "characters"
+ add_foreign_key "bazaar_orders", "items"
add_foreign_key "built_hearth_amenities", "hearth_amenities"
add_foreign_key "built_hearth_amenities", "hearths"
add_foreign_key "character_items", "characters"