mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-28 21:07:16 +00:00
Merge pull request #7086 from Matt-Yorkley/adjustments-index
[Adjustments] Add index on spree_adjustments.order_id
This commit is contained in:
5
db/migrate/20210312095840_add_index_to_adjustments.rb
Normal file
5
db/migrate/20210312095840_add_index_to_adjustments.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddIndexToAdjustments < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
add_index :spree_adjustments, :order_id
|
||||
end
|
||||
end
|
||||
424
db/schema.rb
424
db/schema.rb
@@ -1,4 +1,3 @@
|
||||
# encoding: UTF-8
|
||||
# This file is auto-generated from the current state of the database. Instead
|
||||
# of editing this file, please use the migrations feature of Active Record to
|
||||
# incrementally modify your database, and then regenerate this schema definition.
|
||||
@@ -11,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
ActiveRecord::Schema.define(version: 20210312095840) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
@@ -22,11 +21,10 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.string "fee_name", limit: 255
|
||||
t.string "fee_type", limit: 255
|
||||
t.string "enterprise_role", limit: 255
|
||||
t.index ["adjustment_id"], name: "index_adjustment_metadata_on_adjustment_id", using: :btree
|
||||
t.index ["enterprise_id"], name: "index_adjustment_metadata_on_enterprise_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "adjustment_metadata", ["adjustment_id"], name: "index_adjustment_metadata_on_adjustment_id", using: :btree
|
||||
add_index "adjustment_metadata", ["enterprise_id"], name: "index_adjustment_metadata_on_enterprise_id", using: :btree
|
||||
|
||||
create_table "column_preferences", force: :cascade do |t|
|
||||
t.integer "user_id", null: false
|
||||
t.string "action_name", limit: 255, null: false
|
||||
@@ -34,18 +32,16 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.boolean "visible", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["user_id", "action_name", "column_name"], name: "index_column_prefs_on_user_id_and_action_name_and_column_name", unique: true, using: :btree
|
||||
end
|
||||
|
||||
add_index "column_preferences", ["user_id", "action_name", "column_name"], name: "index_column_prefs_on_user_id_and_action_name_and_column_name", unique: true, using: :btree
|
||||
|
||||
create_table "coordinator_fees", force: :cascade do |t|
|
||||
t.integer "order_cycle_id"
|
||||
t.integer "enterprise_fee_id"
|
||||
t.index ["enterprise_fee_id"], name: "index_coordinator_fees_on_enterprise_fee_id", using: :btree
|
||||
t.index ["order_cycle_id"], name: "index_coordinator_fees_on_order_cycle_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "coordinator_fees", ["enterprise_fee_id"], name: "index_coordinator_fees_on_enterprise_fee_id", using: :btree
|
||||
add_index "coordinator_fees", ["order_cycle_id"], name: "index_coordinator_fees_on_order_cycle_id", using: :btree
|
||||
|
||||
create_table "customers", force: :cascade do |t|
|
||||
t.string "email", limit: 255, null: false
|
||||
t.integer "enterprise_id", null: false
|
||||
@@ -58,14 +54,13 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.string "name", limit: 255
|
||||
t.boolean "allow_charges", default: false, null: false
|
||||
t.datetime "terms_and_conditions_accepted_at"
|
||||
t.index ["bill_address_id"], name: "index_customers_on_bill_address_id", using: :btree
|
||||
t.index ["email"], name: "index_customers_on_email", using: :btree
|
||||
t.index ["enterprise_id", "code"], name: "index_customers_on_enterprise_id_and_code", unique: true, using: :btree
|
||||
t.index ["ship_address_id"], name: "index_customers_on_ship_address_id", using: :btree
|
||||
t.index ["user_id"], name: "index_customers_on_user_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "customers", ["bill_address_id"], name: "index_customers_on_bill_address_id", using: :btree
|
||||
add_index "customers", ["email"], name: "index_customers_on_email", using: :btree
|
||||
add_index "customers", ["enterprise_id", "code"], name: "index_customers_on_enterprise_id_and_code", unique: true, using: :btree
|
||||
add_index "customers", ["ship_address_id"], name: "index_customers_on_ship_address_id", using: :btree
|
||||
add_index "customers", ["user_id"], name: "index_customers_on_user_id", using: :btree
|
||||
|
||||
create_table "delayed_jobs", force: :cascade do |t|
|
||||
t.integer "priority", default: 0, null: false
|
||||
t.integer "attempts", default: 0, null: false
|
||||
@@ -78,28 +73,25 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.string "queue", limit: 255
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["priority", "run_at"], name: "delayed_jobs_priority", using: :btree
|
||||
end
|
||||
|
||||
add_index "delayed_jobs", ["priority", "run_at"], name: "delayed_jobs_priority", using: :btree
|
||||
|
||||
create_table "distributors_payment_methods", id: false, force: :cascade do |t|
|
||||
t.integer "distributor_id"
|
||||
t.integer "payment_method_id"
|
||||
t.index ["distributor_id"], name: "index_distributors_payment_methods_on_distributor_id", using: :btree
|
||||
t.index ["payment_method_id"], name: "index_distributors_payment_methods_on_payment_method_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "distributors_payment_methods", ["distributor_id"], name: "index_distributors_payment_methods_on_distributor_id", using: :btree
|
||||
add_index "distributors_payment_methods", ["payment_method_id"], name: "index_distributors_payment_methods_on_payment_method_id", using: :btree
|
||||
|
||||
create_table "distributors_shipping_methods", force: :cascade do |t|
|
||||
t.integer "distributor_id"
|
||||
t.integer "shipping_method_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["distributor_id"], name: "index_distributors_shipping_methods_on_distributor_id", using: :btree
|
||||
t.index ["shipping_method_id"], name: "index_distributors_shipping_methods_on_shipping_method_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "distributors_shipping_methods", ["distributor_id"], name: "index_distributors_shipping_methods_on_distributor_id", using: :btree
|
||||
add_index "distributors_shipping_methods", ["shipping_method_id"], name: "index_distributors_shipping_methods_on_shipping_method_id", using: :btree
|
||||
|
||||
create_table "enterprise_fees", force: :cascade do |t|
|
||||
t.integer "enterprise_id"
|
||||
t.string "fee_type", limit: 255
|
||||
@@ -109,11 +101,10 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.integer "tax_category_id"
|
||||
t.boolean "inherits_tax_category", default: false, null: false
|
||||
t.datetime "deleted_at"
|
||||
t.index ["enterprise_id"], name: "index_enterprise_fees_on_enterprise_id", using: :btree
|
||||
t.index ["tax_category_id"], name: "index_enterprise_fees_on_tax_category_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "enterprise_fees", ["enterprise_id"], name: "index_enterprise_fees_on_enterprise_id", using: :btree
|
||||
add_index "enterprise_fees", ["tax_category_id"], name: "index_enterprise_fees_on_tax_category_id", using: :btree
|
||||
|
||||
create_table "enterprise_groups", force: :cascade do |t|
|
||||
t.string "name", limit: 255
|
||||
t.boolean "on_front_page"
|
||||
@@ -137,47 +128,42 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.string "twitter", limit: 255, default: "", null: false
|
||||
t.integer "owner_id"
|
||||
t.string "permalink", limit: 255, null: false
|
||||
t.index ["address_id"], name: "index_enterprise_groups_on_address_id", using: :btree
|
||||
t.index ["owner_id"], name: "index_enterprise_groups_on_owner_id", using: :btree
|
||||
t.index ["permalink"], name: "index_enterprise_groups_on_permalink", unique: true, using: :btree
|
||||
end
|
||||
|
||||
add_index "enterprise_groups", ["address_id"], name: "index_enterprise_groups_on_address_id", using: :btree
|
||||
add_index "enterprise_groups", ["owner_id"], name: "index_enterprise_groups_on_owner_id", using: :btree
|
||||
add_index "enterprise_groups", ["permalink"], name: "index_enterprise_groups_on_permalink", unique: true, using: :btree
|
||||
|
||||
create_table "enterprise_groups_enterprises", id: false, force: :cascade do |t|
|
||||
t.integer "enterprise_group_id"
|
||||
t.integer "enterprise_id"
|
||||
t.index ["enterprise_group_id"], name: "index_enterprise_groups_enterprises_on_enterprise_group_id", using: :btree
|
||||
t.index ["enterprise_id"], name: "index_enterprise_groups_enterprises_on_enterprise_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "enterprise_groups_enterprises", ["enterprise_group_id"], name: "index_enterprise_groups_enterprises_on_enterprise_group_id", using: :btree
|
||||
add_index "enterprise_groups_enterprises", ["enterprise_id"], name: "index_enterprise_groups_enterprises_on_enterprise_id", using: :btree
|
||||
|
||||
create_table "enterprise_relationship_permissions", force: :cascade do |t|
|
||||
t.integer "enterprise_relationship_id"
|
||||
t.string "name", limit: 255, null: false
|
||||
t.index ["enterprise_relationship_id"], name: "index_erp_on_erid", using: :btree
|
||||
end
|
||||
|
||||
add_index "enterprise_relationship_permissions", ["enterprise_relationship_id"], name: "index_erp_on_erid", using: :btree
|
||||
|
||||
create_table "enterprise_relationships", force: :cascade do |t|
|
||||
t.integer "parent_id"
|
||||
t.integer "child_id"
|
||||
t.index ["child_id"], name: "index_enterprise_relationships_on_child_id", using: :btree
|
||||
t.index ["parent_id", "child_id"], name: "index_enterprise_relationships_on_parent_id_and_child_id", unique: true, using: :btree
|
||||
t.index ["parent_id"], name: "index_enterprise_relationships_on_parent_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "enterprise_relationships", ["child_id"], name: "index_enterprise_relationships_on_child_id", using: :btree
|
||||
add_index "enterprise_relationships", ["parent_id", "child_id"], name: "index_enterprise_relationships_on_parent_id_and_child_id", unique: true, using: :btree
|
||||
add_index "enterprise_relationships", ["parent_id"], name: "index_enterprise_relationships_on_parent_id", using: :btree
|
||||
|
||||
create_table "enterprise_roles", force: :cascade do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "enterprise_id"
|
||||
t.boolean "receives_notifications", default: false
|
||||
t.index ["enterprise_id", "user_id"], name: "index_enterprise_roles_on_enterprise_id_and_user_id", unique: true, using: :btree
|
||||
t.index ["enterprise_id"], name: "index_enterprise_roles_on_enterprise_id", using: :btree
|
||||
t.index ["user_id", "enterprise_id"], name: "index_enterprise_roles_on_user_id_and_enterprise_id", unique: true, using: :btree
|
||||
t.index ["user_id"], name: "index_enterprise_roles_on_user_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "enterprise_roles", ["enterprise_id", "user_id"], name: "index_enterprise_roles_on_enterprise_id_and_user_id", unique: true, using: :btree
|
||||
add_index "enterprise_roles", ["enterprise_id"], name: "index_enterprise_roles_on_enterprise_id", using: :btree
|
||||
add_index "enterprise_roles", ["user_id", "enterprise_id"], name: "index_enterprise_roles_on_user_id_and_enterprise_id", unique: true, using: :btree
|
||||
add_index "enterprise_roles", ["user_id"], name: "index_enterprise_roles_on_user_id", using: :btree
|
||||
|
||||
create_table "enterprises", force: :cascade do |t|
|
||||
t.string "name", limit: 255
|
||||
t.text "description"
|
||||
@@ -223,35 +209,32 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.string "terms_and_conditions_content_type", limit: 255
|
||||
t.integer "terms_and_conditions_file_size"
|
||||
t.datetime "terms_and_conditions_updated_at"
|
||||
t.index ["address_id"], name: "index_enterprises_on_address_id", using: :btree
|
||||
t.index ["is_primary_producer", "sells"], name: "index_enterprises_on_is_primary_producer_and_sells", using: :btree
|
||||
t.index ["name"], name: "index_enterprises_on_name", unique: true, using: :btree
|
||||
t.index ["owner_id"], name: "index_enterprises_on_owner_id", using: :btree
|
||||
t.index ["permalink"], name: "index_enterprises_on_permalink", unique: true, using: :btree
|
||||
t.index ["sells"], name: "index_enterprises_on_sells", using: :btree
|
||||
end
|
||||
|
||||
add_index "enterprises", ["address_id"], name: "index_enterprises_on_address_id", using: :btree
|
||||
add_index "enterprises", ["is_primary_producer", "sells"], name: "index_enterprises_on_is_primary_producer_and_sells", using: :btree
|
||||
add_index "enterprises", ["name"], name: "index_enterprises_on_name", unique: true, using: :btree
|
||||
add_index "enterprises", ["owner_id"], name: "index_enterprises_on_owner_id", using: :btree
|
||||
add_index "enterprises", ["permalink"], name: "index_enterprises_on_permalink", unique: true, using: :btree
|
||||
add_index "enterprises", ["sells"], name: "index_enterprises_on_sells", using: :btree
|
||||
|
||||
create_table "exchange_fees", force: :cascade do |t|
|
||||
t.integer "exchange_id"
|
||||
t.integer "enterprise_fee_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["enterprise_fee_id"], name: "index_exchange_fees_on_enterprise_fee_id", using: :btree
|
||||
t.index ["exchange_id"], name: "index_exchange_fees_on_exchange_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "exchange_fees", ["enterprise_fee_id"], name: "index_exchange_fees_on_enterprise_fee_id", using: :btree
|
||||
add_index "exchange_fees", ["exchange_id"], name: "index_exchange_fees_on_exchange_id", using: :btree
|
||||
|
||||
create_table "exchange_variants", force: :cascade do |t|
|
||||
t.integer "exchange_id"
|
||||
t.integer "variant_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["exchange_id"], name: "index_exchange_variants_on_exchange_id", using: :btree
|
||||
t.index ["variant_id"], name: "index_exchange_variants_on_variant_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "exchange_variants", ["exchange_id"], name: "index_exchange_variants_on_exchange_id", using: :btree
|
||||
add_index "exchange_variants", ["variant_id"], name: "index_exchange_variants_on_variant_id", using: :btree
|
||||
|
||||
create_table "exchanges", force: :cascade do |t|
|
||||
t.integer "order_cycle_id"
|
||||
t.integer "sender_id"
|
||||
@@ -262,32 +245,29 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.datetime "updated_at", null: false
|
||||
t.boolean "incoming", default: false, null: false
|
||||
t.text "receival_instructions"
|
||||
t.index ["order_cycle_id"], name: "index_exchanges_on_order_cycle_id", using: :btree
|
||||
t.index ["receiver_id"], name: "index_exchanges_on_receiver_id", using: :btree
|
||||
t.index ["sender_id"], name: "index_exchanges_on_sender_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "exchanges", ["order_cycle_id"], name: "index_exchanges_on_order_cycle_id", using: :btree
|
||||
add_index "exchanges", ["receiver_id"], name: "index_exchanges_on_receiver_id", using: :btree
|
||||
add_index "exchanges", ["sender_id"], name: "index_exchanges_on_sender_id", using: :btree
|
||||
|
||||
create_table "inventory_items", force: :cascade do |t|
|
||||
t.integer "enterprise_id", null: false
|
||||
t.integer "variant_id", null: false
|
||||
t.boolean "visible", default: true, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["enterprise_id", "variant_id"], name: "index_inventory_items_on_enterprise_id_and_variant_id", unique: true, using: :btree
|
||||
end
|
||||
|
||||
add_index "inventory_items", ["enterprise_id", "variant_id"], name: "index_inventory_items_on_enterprise_id_and_variant_id", unique: true, using: :btree
|
||||
|
||||
create_table "order_cycle_schedules", force: :cascade do |t|
|
||||
t.integer "order_cycle_id", null: false
|
||||
t.integer "schedule_id", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["order_cycle_id"], name: "index_order_cycle_schedules_on_order_cycle_id", using: :btree
|
||||
t.index ["schedule_id"], name: "index_order_cycle_schedules_on_schedule_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "order_cycle_schedules", ["order_cycle_id"], name: "index_order_cycle_schedules_on_order_cycle_id", using: :btree
|
||||
add_index "order_cycle_schedules", ["schedule_id"], name: "index_order_cycle_schedules_on_schedule_id", using: :btree
|
||||
|
||||
create_table "order_cycles", force: :cascade do |t|
|
||||
t.string "name", limit: 255
|
||||
t.datetime "orders_open_at"
|
||||
@@ -304,12 +284,11 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.integer "position", default: 0, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["position"], name: "index_producer_properties_on_position", using: :btree
|
||||
t.index ["producer_id"], name: "index_producer_properties_on_producer_id", using: :btree
|
||||
t.index ["property_id"], name: "index_producer_properties_on_property_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "producer_properties", ["position"], name: "index_producer_properties_on_position", using: :btree
|
||||
add_index "producer_properties", ["producer_id"], name: "index_producer_properties_on_producer_id", using: :btree
|
||||
add_index "producer_properties", ["property_id"], name: "index_producer_properties_on_property_id", using: :btree
|
||||
|
||||
create_table "proxy_orders", force: :cascade do |t|
|
||||
t.integer "subscription_id", null: false
|
||||
t.integer "order_id"
|
||||
@@ -319,12 +298,11 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.integer "order_cycle_id", null: false
|
||||
t.datetime "placed_at"
|
||||
t.datetime "confirmed_at"
|
||||
t.index ["order_cycle_id", "subscription_id"], name: "index_proxy_orders_on_order_cycle_id_and_subscription_id", unique: true, using: :btree
|
||||
t.index ["order_id"], name: "index_proxy_orders_on_order_id", unique: true, using: :btree
|
||||
t.index ["subscription_id"], name: "index_proxy_orders_on_subscription_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "proxy_orders", ["order_cycle_id", "subscription_id"], name: "index_proxy_orders_on_order_cycle_id_and_subscription_id", unique: true, using: :btree
|
||||
add_index "proxy_orders", ["order_id"], name: "index_proxy_orders_on_order_id", unique: true, using: :btree
|
||||
add_index "proxy_orders", ["subscription_id"], name: "index_proxy_orders_on_subscription_id", using: :btree
|
||||
|
||||
create_table "schedules", force: :cascade do |t|
|
||||
t.string "name", limit: 255, null: false
|
||||
t.datetime "created_at", null: false
|
||||
@@ -336,11 +314,10 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.text "data"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["session_id"], name: "index_sessions_on_session_id", using: :btree
|
||||
t.index ["updated_at"], name: "index_sessions_on_updated_at", using: :btree
|
||||
end
|
||||
|
||||
add_index "sessions", ["session_id"], name: "index_sessions_on_session_id", using: :btree
|
||||
add_index "sessions", ["updated_at"], name: "index_sessions_on_updated_at", using: :btree
|
||||
|
||||
create_table "spree_activators", force: :cascade do |t|
|
||||
t.string "description", limit: 255
|
||||
t.datetime "expires_at"
|
||||
@@ -374,11 +351,10 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.string "company", limit: 255
|
||||
t.float "latitude"
|
||||
t.float "longitude"
|
||||
t.index ["firstname"], name: "index_addresses_on_firstname", using: :btree
|
||||
t.index ["lastname"], name: "index_addresses_on_lastname", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_addresses", ["firstname"], name: "index_addresses_on_firstname", using: :btree
|
||||
add_index "spree_addresses", ["lastname"], name: "index_addresses_on_lastname", using: :btree
|
||||
|
||||
create_table "spree_adjustments", force: :cascade do |t|
|
||||
t.integer "source_id"
|
||||
t.decimal "amount", precision: 10, scale: 2
|
||||
@@ -392,14 +368,14 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.string "originator_type", limit: 255
|
||||
t.boolean "eligible", default: true
|
||||
t.string "adjustable_type", limit: 255
|
||||
t.decimal "included_tax", precision: 10, scale: 2, default: 0.0, null: false
|
||||
t.decimal "included_tax", precision: 10, scale: 2, default: "0.0", null: false
|
||||
t.string "state", limit: 255
|
||||
t.integer "order_id"
|
||||
t.boolean "included", default: false
|
||||
t.index ["adjustable_id"], name: "index_adjustments_on_order_id", using: :btree
|
||||
t.index ["order_id"], name: "index_spree_adjustments_on_order_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_adjustments", ["adjustable_id"], name: "index_adjustments_on_order_id", using: :btree
|
||||
|
||||
create_table "spree_assets", force: :cascade do |t|
|
||||
t.integer "viewable_id"
|
||||
t.integer "attachment_width"
|
||||
@@ -412,11 +388,10 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.string "type", limit: 75
|
||||
t.datetime "attachment_updated_at"
|
||||
t.text "alt"
|
||||
t.index ["viewable_id"], name: "index_assets_on_viewable_id", using: :btree
|
||||
t.index ["viewable_type", "type"], name: "index_assets_on_viewable_type_and_type", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_assets", ["viewable_id"], name: "index_assets_on_viewable_id", using: :btree
|
||||
add_index "spree_assets", ["viewable_type", "type"], name: "index_assets_on_viewable_type_and_type", using: :btree
|
||||
|
||||
create_table "spree_calculators", force: :cascade do |t|
|
||||
t.string "type", limit: 255
|
||||
t.integer "calculable_id", null: false
|
||||
@@ -430,10 +405,9 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.string "type", limit: 50
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["name", "type"], name: "index_configurations_on_name_and_type", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_configurations", ["name", "type"], name: "index_configurations_on_name_and_type", using: :btree
|
||||
|
||||
create_table "spree_countries", force: :cascade do |t|
|
||||
t.string "iso_name", limit: 255
|
||||
t.string "iso", limit: 255
|
||||
@@ -461,11 +435,10 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.integer "user_id"
|
||||
t.integer "payment_method_id"
|
||||
t.boolean "is_default", default: false
|
||||
t.index ["payment_method_id"], name: "index_spree_credit_cards_on_payment_method_id", using: :btree
|
||||
t.index ["user_id"], name: "index_spree_credit_cards_on_user_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_credit_cards", ["payment_method_id"], name: "index_spree_credit_cards_on_payment_method_id", using: :btree
|
||||
add_index "spree_credit_cards", ["user_id"], name: "index_spree_credit_cards_on_user_id", using: :btree
|
||||
|
||||
create_table "spree_gateways", force: :cascade do |t|
|
||||
t.string "type", limit: 255
|
||||
t.string "name", limit: 255
|
||||
@@ -487,29 +460,27 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.integer "shipment_id"
|
||||
t.integer "return_authorization_id"
|
||||
t.boolean "pending", default: true
|
||||
t.index ["order_id"], name: "index_inventory_units_on_order_id", using: :btree
|
||||
t.index ["shipment_id"], name: "index_inventory_units_on_shipment_id", using: :btree
|
||||
t.index ["variant_id"], name: "index_inventory_units_on_variant_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_inventory_units", ["order_id"], name: "index_inventory_units_on_order_id", using: :btree
|
||||
add_index "spree_inventory_units", ["shipment_id"], name: "index_inventory_units_on_shipment_id", using: :btree
|
||||
add_index "spree_inventory_units", ["variant_id"], name: "index_inventory_units_on_variant_id", using: :btree
|
||||
|
||||
create_table "spree_line_items", force: :cascade do |t|
|
||||
t.integer "order_id"
|
||||
t.integer "variant_id"
|
||||
t.integer "quantity", null: false
|
||||
t.decimal "price", precision: 10, scale: 2, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.integer "quantity", null: false
|
||||
t.decimal "price", precision: 10, scale: 2, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.integer "max_quantity"
|
||||
t.string "currency", limit: 255
|
||||
t.decimal "distribution_fee", precision: 10, scale: 2
|
||||
t.decimal "final_weight_volume", precision: 10, scale: 2
|
||||
t.string "currency", limit: 255
|
||||
t.decimal "distribution_fee", precision: 10, scale: 2
|
||||
t.decimal "final_weight_volume", precision: 10, scale: 2
|
||||
t.integer "tax_category_id"
|
||||
t.index ["order_id"], name: "index_line_items_on_order_id", using: :btree
|
||||
t.index ["variant_id"], name: "index_line_items_on_variant_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_line_items", ["order_id"], name: "index_line_items_on_order_id", using: :btree
|
||||
add_index "spree_line_items", ["variant_id"], name: "index_line_items_on_variant_id", using: :btree
|
||||
|
||||
create_table "spree_log_entries", force: :cascade do |t|
|
||||
t.integer "source_id"
|
||||
t.string "source_type", limit: 255
|
||||
@@ -538,31 +509,29 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
create_table "spree_option_values_line_items", id: false, force: :cascade do |t|
|
||||
t.integer "line_item_id"
|
||||
t.integer "option_value_id"
|
||||
t.index ["line_item_id"], name: "index_option_values_line_items_on_line_item_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_option_values_line_items", ["line_item_id"], name: "index_option_values_line_items_on_line_item_id", using: :btree
|
||||
|
||||
create_table "spree_option_values_variants", id: false, force: :cascade do |t|
|
||||
t.integer "variant_id"
|
||||
t.integer "option_value_id"
|
||||
t.index ["variant_id", "option_value_id"], name: "index_option_values_variants_on_variant_id_and_option_value_id", using: :btree
|
||||
t.index ["variant_id"], name: "index_option_values_variants_on_variant_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_option_values_variants", ["variant_id", "option_value_id"], name: "index_option_values_variants_on_variant_id_and_option_value_id", using: :btree
|
||||
add_index "spree_option_values_variants", ["variant_id"], name: "index_option_values_variants_on_variant_id", using: :btree
|
||||
|
||||
create_table "spree_orders", force: :cascade do |t|
|
||||
t.string "number", limit: 15
|
||||
t.decimal "item_total", precision: 10, scale: 2, default: 0.0, null: false
|
||||
t.decimal "total", precision: 10, scale: 2, default: 0.0, null: false
|
||||
t.decimal "item_total", precision: 10, scale: 2, default: "0.0", null: false
|
||||
t.decimal "total", precision: 10, scale: 2, default: "0.0", null: false
|
||||
t.string "state", limit: 255
|
||||
t.decimal "adjustment_total", precision: 10, scale: 2, default: 0.0, null: false
|
||||
t.decimal "adjustment_total", precision: 10, scale: 2, default: "0.0", null: false
|
||||
t.integer "user_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.datetime "completed_at"
|
||||
t.integer "bill_address_id"
|
||||
t.integer "ship_address_id"
|
||||
t.decimal "payment_total", precision: 10, scale: 2, default: 0.0
|
||||
t.decimal "payment_total", precision: 10, scale: 2, default: "0.0"
|
||||
t.string "shipment_state", limit: 255
|
||||
t.string "payment_state", limit: 255
|
||||
t.string "email", limit: 255
|
||||
@@ -573,17 +542,16 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.string "last_ip_address", limit: 255
|
||||
t.integer "customer_id"
|
||||
t.integer "created_by_id"
|
||||
t.decimal "included_tax_total", precision: 10, scale: 2, default: 0.0, null: false
|
||||
t.decimal "additional_tax_total", precision: 10, scale: 2, default: 0.0, null: false
|
||||
t.decimal "included_tax_total", precision: 10, scale: 2, default: "0.0", null: false
|
||||
t.decimal "additional_tax_total", precision: 10, scale: 2, default: "0.0", null: false
|
||||
t.index ["completed_at", "user_id", "created_by_id", "created_at"], name: "spree_orders_completed_at_user_id_created_by_id_created_at_idx", using: :btree
|
||||
t.index ["customer_id"], name: "index_spree_orders_on_customer_id", using: :btree
|
||||
t.index ["distributor_id"], name: "index_spree_orders_on_distributor_id", using: :btree
|
||||
t.index ["number"], name: "index_orders_on_number", using: :btree
|
||||
t.index ["order_cycle_id"], name: "index_spree_orders_on_order_cycle_id", using: :btree
|
||||
t.index ["user_id"], name: "index_spree_orders_on_user_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_orders", ["completed_at", "user_id", "created_by_id", "created_at"], name: "spree_orders_completed_at_user_id_created_by_id_created_at_idx", using: :btree
|
||||
add_index "spree_orders", ["customer_id"], name: "index_spree_orders_on_customer_id", using: :btree
|
||||
add_index "spree_orders", ["distributor_id"], name: "index_spree_orders_on_distributor_id", using: :btree
|
||||
add_index "spree_orders", ["number"], name: "index_orders_on_number", using: :btree
|
||||
add_index "spree_orders", ["order_cycle_id"], name: "index_spree_orders_on_order_cycle_id", using: :btree
|
||||
add_index "spree_orders", ["user_id"], name: "index_spree_orders_on_user_id", using: :btree
|
||||
|
||||
create_table "spree_payment_methods", force: :cascade do |t|
|
||||
t.string "type", limit: 255
|
||||
t.string "name", limit: 255
|
||||
@@ -597,10 +565,10 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
end
|
||||
|
||||
create_table "spree_payments", force: :cascade do |t|
|
||||
t.decimal "amount", precision: 10, scale: 2, default: 0.0, null: false
|
||||
t.decimal "amount", precision: 10, scale: 2, default: "0.0", null: false
|
||||
t.integer "order_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.integer "source_id"
|
||||
t.string "source_type", limit: 255
|
||||
t.integer "payment_method_id"
|
||||
@@ -610,10 +578,9 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.string "identifier", limit: 255
|
||||
t.string "cvv_response_code", limit: 255
|
||||
t.text "cvv_response_message"
|
||||
t.index ["order_id"], name: "index_spree_payments_on_order_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_payments", ["order_id"], name: "index_spree_payments_on_order_id", using: :btree
|
||||
|
||||
create_table "spree_paypal_accounts", force: :cascade do |t|
|
||||
t.string "email", limit: 255
|
||||
t.string "payer_id", limit: 255
|
||||
@@ -630,46 +597,41 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.datetime "refunded_at"
|
||||
t.string "refund_type", limit: 255
|
||||
t.datetime "created_at"
|
||||
t.index ["transaction_id"], name: "index_spree_paypal_express_checkouts_on_transaction_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_paypal_express_checkouts", ["transaction_id"], name: "index_spree_paypal_express_checkouts_on_transaction_id", using: :btree
|
||||
|
||||
create_table "spree_pending_promotions", force: :cascade do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "promotion_id"
|
||||
t.index ["promotion_id"], name: "index_spree_pending_promotions_on_promotion_id", using: :btree
|
||||
t.index ["user_id"], name: "index_spree_pending_promotions_on_user_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_pending_promotions", ["promotion_id"], name: "index_spree_pending_promotions_on_promotion_id", using: :btree
|
||||
add_index "spree_pending_promotions", ["user_id"], name: "index_spree_pending_promotions_on_user_id", using: :btree
|
||||
|
||||
create_table "spree_preferences", force: :cascade do |t|
|
||||
t.text "value"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.string "key", limit: 255
|
||||
t.string "value_type", limit: 255
|
||||
t.index ["key"], name: "index_spree_preferences_on_key", unique: true, using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_preferences", ["key"], name: "index_spree_preferences_on_key", unique: true, using: :btree
|
||||
|
||||
create_table "spree_prices", force: :cascade do |t|
|
||||
t.integer "variant_id", null: false
|
||||
t.decimal "amount", precision: 10, scale: 2
|
||||
t.string "currency", limit: 255
|
||||
t.datetime "deleted_at"
|
||||
t.index ["variant_id"], name: "index_spree_prices_on_variant_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_prices", ["variant_id"], name: "index_spree_prices_on_variant_id", using: :btree
|
||||
|
||||
create_table "spree_product_groups", force: :cascade do |t|
|
||||
t.string "name", limit: 255
|
||||
t.string "permalink", limit: 255
|
||||
t.string "order", limit: 255
|
||||
t.index ["name"], name: "index_product_groups_on_name", using: :btree
|
||||
t.index ["permalink"], name: "index_product_groups_on_permalink", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_product_groups", ["name"], name: "index_product_groups_on_name", using: :btree
|
||||
add_index "spree_product_groups", ["permalink"], name: "index_product_groups_on_permalink", using: :btree
|
||||
|
||||
create_table "spree_product_groups_products", id: false, force: :cascade do |t|
|
||||
t.integer "product_id"
|
||||
t.integer "product_group_id"
|
||||
@@ -690,19 +652,17 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.integer "position", default: 0
|
||||
t.index ["product_id"], name: "index_product_properties_on_product_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_product_properties", ["product_id"], name: "index_product_properties_on_product_id", using: :btree
|
||||
|
||||
create_table "spree_product_scopes", force: :cascade do |t|
|
||||
t.string "name", limit: 255
|
||||
t.text "arguments"
|
||||
t.integer "product_group_id"
|
||||
t.index ["name"], name: "index_product_scopes_on_name", using: :btree
|
||||
t.index ["product_group_id"], name: "index_product_scopes_on_product_group_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_product_scopes", ["name"], name: "index_product_scopes_on_name", using: :btree
|
||||
add_index "spree_product_scopes", ["product_group_id"], name: "index_product_scopes_on_product_group_id", using: :btree
|
||||
|
||||
create_table "spree_products", force: :cascade do |t|
|
||||
t.string "name", limit: 255, default: "", null: false
|
||||
t.text "description"
|
||||
@@ -724,32 +684,29 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.text "notes"
|
||||
t.integer "primary_taxon_id", null: false
|
||||
t.boolean "inherits_properties", default: true, null: false
|
||||
t.index ["available_on"], name: "index_products_on_available_on", using: :btree
|
||||
t.index ["deleted_at"], name: "index_products_on_deleted_at", using: :btree
|
||||
t.index ["name"], name: "index_products_on_name", using: :btree
|
||||
t.index ["permalink"], name: "index_products_on_permalink", using: :btree
|
||||
t.index ["permalink"], name: "permalink_idx_unique", unique: true, using: :btree
|
||||
t.index ["primary_taxon_id"], name: "index_spree_products_on_primary_taxon_id", using: :btree
|
||||
t.index ["supplier_id"], name: "index_spree_products_on_supplier_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_products", ["available_on"], name: "index_products_on_available_on", using: :btree
|
||||
add_index "spree_products", ["deleted_at"], name: "index_products_on_deleted_at", using: :btree
|
||||
add_index "spree_products", ["name"], name: "index_products_on_name", using: :btree
|
||||
add_index "spree_products", ["permalink"], name: "index_products_on_permalink", using: :btree
|
||||
add_index "spree_products", ["permalink"], name: "permalink_idx_unique", unique: true, using: :btree
|
||||
add_index "spree_products", ["primary_taxon_id"], name: "index_spree_products_on_primary_taxon_id", using: :btree
|
||||
add_index "spree_products", ["supplier_id"], name: "index_spree_products_on_supplier_id", using: :btree
|
||||
|
||||
create_table "spree_products_promotion_rules", id: false, force: :cascade do |t|
|
||||
t.integer "product_id"
|
||||
t.integer "promotion_rule_id"
|
||||
t.index ["product_id"], name: "index_products_promotion_rules_on_product_id", using: :btree
|
||||
t.index ["promotion_rule_id"], name: "index_products_promotion_rules_on_promotion_rule_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_products_promotion_rules", ["product_id"], name: "index_products_promotion_rules_on_product_id", using: :btree
|
||||
add_index "spree_products_promotion_rules", ["promotion_rule_id"], name: "index_products_promotion_rules_on_promotion_rule_id", using: :btree
|
||||
|
||||
create_table "spree_products_taxons", force: :cascade do |t|
|
||||
t.integer "product_id"
|
||||
t.integer "taxon_id"
|
||||
t.index ["product_id"], name: "index_products_taxons_on_product_id", using: :btree
|
||||
t.index ["taxon_id"], name: "index_products_taxons_on_taxon_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_products_taxons", ["product_id"], name: "index_products_taxons_on_product_id", using: :btree
|
||||
add_index "spree_products_taxons", ["taxon_id"], name: "index_products_taxons_on_taxon_id", using: :btree
|
||||
|
||||
create_table "spree_promotion_action_line_items", force: :cascade do |t|
|
||||
t.integer "promotion_action_id"
|
||||
t.integer "variant_id"
|
||||
@@ -769,19 +726,17 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.string "type", limit: 255
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["product_group_id"], name: "index_promotion_rules_on_product_group_id", using: :btree
|
||||
t.index ["user_id"], name: "index_promotion_rules_on_user_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_promotion_rules", ["product_group_id"], name: "index_promotion_rules_on_product_group_id", using: :btree
|
||||
add_index "spree_promotion_rules", ["user_id"], name: "index_promotion_rules_on_user_id", using: :btree
|
||||
|
||||
create_table "spree_promotion_rules_users", id: false, force: :cascade do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "promotion_rule_id"
|
||||
t.index ["promotion_rule_id"], name: "index_promotion_rules_users_on_promotion_rule_id", using: :btree
|
||||
t.index ["user_id"], name: "index_promotion_rules_users_on_user_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_promotion_rules_users", ["promotion_rule_id"], name: "index_promotion_rules_users_on_promotion_rule_id", using: :btree
|
||||
add_index "spree_promotion_rules_users", ["user_id"], name: "index_promotion_rules_users_on_user_id", using: :btree
|
||||
|
||||
create_table "spree_properties", force: :cascade do |t|
|
||||
t.string "name", limit: 255
|
||||
t.string "presentation", limit: 255, null: false
|
||||
@@ -792,11 +747,11 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
create_table "spree_return_authorizations", force: :cascade do |t|
|
||||
t.string "number", limit: 255
|
||||
t.string "state", limit: 255
|
||||
t.decimal "amount", precision: 10, scale: 2, default: 0.0, null: false
|
||||
t.decimal "amount", precision: 10, scale: 2, default: "0.0", null: false
|
||||
t.integer "order_id"
|
||||
t.text "reason"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.integer "stock_location_id"
|
||||
end
|
||||
|
||||
@@ -807,27 +762,25 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
create_table "spree_roles_users", id: false, force: :cascade do |t|
|
||||
t.integer "role_id"
|
||||
t.integer "user_id"
|
||||
t.index ["role_id"], name: "index_roles_users_on_role_id", using: :btree
|
||||
t.index ["user_id"], name: "index_roles_users_on_user_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_roles_users", ["role_id"], name: "index_roles_users_on_role_id", using: :btree
|
||||
add_index "spree_roles_users", ["user_id"], name: "index_roles_users_on_user_id", using: :btree
|
||||
|
||||
create_table "spree_shipments", force: :cascade do |t|
|
||||
t.string "tracking", limit: 255
|
||||
t.string "number", limit: 255
|
||||
t.decimal "cost", precision: 10, scale: 2, default: 0.0, null: false
|
||||
t.string "tracking", limit: 255
|
||||
t.string "number", limit: 255
|
||||
t.decimal "cost", precision: 10, scale: 2, default: "0.0", null: false
|
||||
t.datetime "shipped_at"
|
||||
t.integer "order_id"
|
||||
t.integer "address_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.string "state", limit: 255
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.string "state", limit: 255
|
||||
t.integer "stock_location_id"
|
||||
t.index ["number"], name: "index_shipments_on_number", using: :btree
|
||||
t.index ["order_id"], name: "index_spree_shipments_on_order_id", unique: true, using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_shipments", ["number"], name: "index_shipments_on_number", using: :btree
|
||||
add_index "spree_shipments", ["order_id"], name: "index_spree_shipments_on_order_id", unique: true, using: :btree
|
||||
|
||||
create_table "spree_shipping_categories", force: :cascade do |t|
|
||||
t.string "name", limit: 255
|
||||
t.datetime "created_at", null: false
|
||||
@@ -840,11 +793,10 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.integer "shipping_category_id", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["shipping_category_id"], name: "index_spree_shipping_method_categories_on_shipping_category_id", using: :btree
|
||||
t.index ["shipping_method_id"], name: "index_spree_shipping_method_categories_on_shipping_method_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_shipping_method_categories", ["shipping_category_id"], name: "index_spree_shipping_method_categories_on_shipping_category_id", using: :btree
|
||||
add_index "spree_shipping_method_categories", ["shipping_method_id"], name: "index_spree_shipping_method_categories_on_shipping_method_id", using: :btree
|
||||
|
||||
create_table "spree_shipping_methods", force: :cascade do |t|
|
||||
t.string "name", limit: 255
|
||||
t.datetime "created_at", null: false
|
||||
@@ -865,13 +817,12 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.integer "shipment_id"
|
||||
t.integer "shipping_method_id"
|
||||
t.boolean "selected", default: false
|
||||
t.decimal "cost", precision: 10, scale: 2, default: 0.0
|
||||
t.decimal "cost", precision: 10, scale: 2, default: "0.0"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["shipment_id", "shipping_method_id"], name: "spree_shipping_rates_join_index", unique: true, using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_shipping_rates", ["shipment_id", "shipping_method_id"], name: "spree_shipping_rates_join_index", unique: true, using: :btree
|
||||
|
||||
create_table "spree_skrill_transactions", force: :cascade do |t|
|
||||
t.string "email", limit: 255
|
||||
t.float "amount"
|
||||
@@ -892,10 +843,9 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.datetime "updated_at", null: false
|
||||
t.string "stateful_type", limit: 255
|
||||
t.string "next_state", limit: 255
|
||||
t.index ["stateful_id"], name: "index_spree_state_changes_on_stateful_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_state_changes", ["stateful_id"], name: "index_spree_state_changes_on_stateful_id", using: :btree
|
||||
|
||||
create_table "spree_states", force: :cascade do |t|
|
||||
t.string "name", limit: 255
|
||||
t.string "abbr", limit: 255
|
||||
@@ -911,12 +861,11 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.boolean "backorderable", default: false
|
||||
t.datetime "deleted_at"
|
||||
t.integer "lock_version", default: 0
|
||||
t.index ["stock_location_id", "variant_id"], name: "stock_item_by_loc_and_var_id", using: :btree
|
||||
t.index ["stock_location_id"], name: "index_spree_stock_items_on_stock_location_id", using: :btree
|
||||
t.index ["variant_id"], name: "index_spree_stock_items_on_variant_id", unique: true, using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_stock_items", ["stock_location_id", "variant_id"], name: "stock_item_by_loc_and_var_id", using: :btree
|
||||
add_index "spree_stock_items", ["stock_location_id"], name: "index_spree_stock_items_on_stock_location_id", using: :btree
|
||||
add_index "spree_stock_items", ["variant_id"], name: "index_spree_stock_items_on_variant_id", unique: true, using: :btree
|
||||
|
||||
create_table "spree_stock_locations", force: :cascade do |t|
|
||||
t.string "name", limit: 255
|
||||
t.datetime "created_at", null: false
|
||||
@@ -942,10 +891,9 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.datetime "updated_at", null: false
|
||||
t.integer "originator_id"
|
||||
t.string "originator_type", limit: 255
|
||||
t.index ["stock_item_id"], name: "index_spree_stock_movements_on_stock_item_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_stock_movements", ["stock_item_id"], name: "index_spree_stock_movements_on_stock_item_id", using: :btree
|
||||
|
||||
create_table "spree_stock_transfers", force: :cascade do |t|
|
||||
t.string "type", limit: 255
|
||||
t.string "reference", limit: 255
|
||||
@@ -954,12 +902,11 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.string "number", limit: 255
|
||||
t.index ["destination_location_id"], name: "index_spree_stock_transfers_on_destination_location_id", using: :btree
|
||||
t.index ["number"], name: "index_spree_stock_transfers_on_number", using: :btree
|
||||
t.index ["source_location_id"], name: "index_spree_stock_transfers_on_source_location_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_stock_transfers", ["destination_location_id"], name: "index_spree_stock_transfers_on_destination_location_id", using: :btree
|
||||
add_index "spree_stock_transfers", ["number"], name: "index_spree_stock_transfers_on_number", using: :btree
|
||||
add_index "spree_stock_transfers", ["source_location_id"], name: "index_spree_stock_transfers_on_source_location_id", using: :btree
|
||||
|
||||
create_table "spree_tax_categories", force: :cascade do |t|
|
||||
t.string "name", limit: 255
|
||||
t.string "description", limit: 255
|
||||
@@ -1006,22 +953,20 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.string "meta_title", limit: 255
|
||||
t.string "meta_description", limit: 255
|
||||
t.string "meta_keywords", limit: 255
|
||||
t.index ["parent_id"], name: "index_taxons_on_parent_id", using: :btree
|
||||
t.index ["permalink"], name: "index_taxons_on_permalink", using: :btree
|
||||
t.index ["taxonomy_id"], name: "index_taxons_on_taxonomy_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_taxons", ["parent_id"], name: "index_taxons_on_parent_id", using: :btree
|
||||
add_index "spree_taxons", ["permalink"], name: "index_taxons_on_permalink", using: :btree
|
||||
add_index "spree_taxons", ["taxonomy_id"], name: "index_taxons_on_taxonomy_id", using: :btree
|
||||
|
||||
create_table "spree_tokenized_permissions", force: :cascade do |t|
|
||||
t.integer "permissable_id"
|
||||
t.string "permissable_type", limit: 255
|
||||
t.string "token", limit: 255
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["permissable_id", "permissable_type"], name: "index_tokenized_name_and_type", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_tokenized_permissions", ["permissable_id", "permissable_type"], name: "index_tokenized_name_and_type", using: :btree
|
||||
|
||||
create_table "spree_users", force: :cascade do |t|
|
||||
t.string "encrypted_password", limit: 255
|
||||
t.string "password_salt", limit: 255
|
||||
@@ -1055,33 +1000,31 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.datetime "confirmed_at"
|
||||
t.datetime "confirmation_sent_at"
|
||||
t.string "unconfirmed_email", limit: 255
|
||||
t.index ["confirmation_token"], name: "index_spree_users_on_confirmation_token", unique: true, using: :btree
|
||||
t.index ["email"], name: "email_idx_unique", unique: true, using: :btree
|
||||
t.index ["persistence_token"], name: "index_users_on_persistence_token", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_users", ["confirmation_token"], name: "index_spree_users_on_confirmation_token", unique: true, using: :btree
|
||||
add_index "spree_users", ["email"], name: "email_idx_unique", unique: true, using: :btree
|
||||
add_index "spree_users", ["persistence_token"], name: "index_users_on_persistence_token", using: :btree
|
||||
|
||||
create_table "spree_variants", force: :cascade do |t|
|
||||
t.string "sku", limit: 255, default: "", null: false
|
||||
t.decimal "weight", precision: 8, scale: 2, default: 0.0, null: false
|
||||
t.decimal "height", precision: 8, scale: 2
|
||||
t.decimal "width", precision: 8, scale: 2
|
||||
t.decimal "depth", precision: 8, scale: 2
|
||||
t.string "sku", limit: 255, default: "", null: false
|
||||
t.decimal "weight", precision: 8, scale: 2, default: "0.0", null: false
|
||||
t.decimal "height", precision: 8, scale: 2
|
||||
t.decimal "width", precision: 8, scale: 2
|
||||
t.decimal "depth", precision: 8, scale: 2
|
||||
t.datetime "deleted_at"
|
||||
t.boolean "is_master", default: false
|
||||
t.boolean "is_master", default: false
|
||||
t.integer "product_id"
|
||||
t.integer "position"
|
||||
t.string "cost_currency", limit: 255
|
||||
t.float "unit_value", default: 1.0, null: false
|
||||
t.string "unit_description", limit: 255, default: ""
|
||||
t.float "unit_value", default: 1.0, null: false
|
||||
t.string "unit_description", limit: 255, default: ""
|
||||
t.string "display_name", limit: 255
|
||||
t.string "display_as", limit: 255
|
||||
t.datetime "import_date"
|
||||
t.index ["product_id"], name: "index_variants_on_product_id", using: :btree
|
||||
t.index ["sku"], name: "index_spree_variants_on_sku", using: :btree
|
||||
end
|
||||
|
||||
add_index "spree_variants", ["product_id"], name: "index_variants_on_product_id", using: :btree
|
||||
add_index "spree_variants", ["sku"], name: "index_spree_variants_on_sku", using: :btree
|
||||
|
||||
create_table "spree_zone_members", force: :cascade do |t|
|
||||
t.integer "zoneable_id"
|
||||
t.string "zoneable_type", limit: 255
|
||||
@@ -1105,10 +1048,9 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.integer "enterprise_id"
|
||||
t.index ["enterprise_id"], name: "index_stripe_accounts_on_enterprise_id", unique: true, using: :btree
|
||||
end
|
||||
|
||||
add_index "stripe_accounts", ["enterprise_id"], name: "index_stripe_accounts_on_enterprise_id", unique: true, using: :btree
|
||||
|
||||
create_table "subscription_line_items", force: :cascade do |t|
|
||||
t.integer "subscription_id", null: false
|
||||
t.integer "variant_id", null: false
|
||||
@@ -1116,11 +1058,10 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.decimal "price_estimate", precision: 10, scale: 2
|
||||
t.index ["subscription_id"], name: "index_subscription_line_items_on_subscription_id", using: :btree
|
||||
t.index ["variant_id"], name: "index_subscription_line_items_on_variant_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "subscription_line_items", ["subscription_id"], name: "index_subscription_line_items_on_subscription_id", using: :btree
|
||||
add_index "subscription_line_items", ["variant_id"], name: "index_subscription_line_items_on_variant_id", using: :btree
|
||||
|
||||
create_table "subscriptions", force: :cascade do |t|
|
||||
t.integer "shop_id", null: false
|
||||
t.integer "customer_id", null: false
|
||||
@@ -1137,16 +1078,15 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.datetime "paused_at"
|
||||
t.decimal "shipping_fee_estimate", precision: 10, scale: 2
|
||||
t.decimal "payment_fee_estimate", precision: 10, scale: 2
|
||||
t.index ["bill_address_id"], name: "index_subscriptions_on_bill_address_id", using: :btree
|
||||
t.index ["customer_id"], name: "index_subscriptions_on_customer_id", using: :btree
|
||||
t.index ["payment_method_id"], name: "index_subscriptions_on_payment_method_id", using: :btree
|
||||
t.index ["schedule_id"], name: "index_subscriptions_on_schedule_id", using: :btree
|
||||
t.index ["ship_address_id"], name: "index_subscriptions_on_ship_address_id", using: :btree
|
||||
t.index ["shipping_method_id"], name: "index_subscriptions_on_shipping_method_id", using: :btree
|
||||
t.index ["shop_id"], name: "index_subscriptions_on_shop_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "subscriptions", ["bill_address_id"], name: "index_subscriptions_on_bill_address_id", using: :btree
|
||||
add_index "subscriptions", ["customer_id"], name: "index_subscriptions_on_customer_id", using: :btree
|
||||
add_index "subscriptions", ["payment_method_id"], name: "index_subscriptions_on_payment_method_id", using: :btree
|
||||
add_index "subscriptions", ["schedule_id"], name: "index_subscriptions_on_schedule_id", using: :btree
|
||||
add_index "subscriptions", ["ship_address_id"], name: "index_subscriptions_on_ship_address_id", using: :btree
|
||||
add_index "subscriptions", ["shipping_method_id"], name: "index_subscriptions_on_shipping_method_id", using: :btree
|
||||
add_index "subscriptions", ["shop_id"], name: "index_subscriptions_on_shop_id", using: :btree
|
||||
|
||||
create_table "suburbs", force: :cascade do |t|
|
||||
t.string "name", limit: 255
|
||||
t.string "postcode", limit: 255
|
||||
@@ -1172,18 +1112,16 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.string "tagger_type", limit: 255
|
||||
t.string "context", limit: 128
|
||||
t.datetime "created_at"
|
||||
t.index ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true, using: :btree
|
||||
t.index ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree
|
||||
end
|
||||
|
||||
add_index "taggings", ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true, using: :btree
|
||||
add_index "taggings", ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree
|
||||
|
||||
create_table "tags", force: :cascade do |t|
|
||||
t.string "name", limit: 255
|
||||
t.integer "taggings_count", default: 0
|
||||
t.index ["name"], name: "index_tags_on_name", unique: true, using: :btree
|
||||
end
|
||||
|
||||
add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree
|
||||
|
||||
create_table "variant_overrides", force: :cascade do |t|
|
||||
t.integer "variant_id", null: false
|
||||
t.integer "hub_id", null: false
|
||||
@@ -1195,10 +1133,9 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.boolean "on_demand"
|
||||
t.datetime "permission_revoked_at"
|
||||
t.datetime "import_date"
|
||||
t.index ["variant_id", "hub_id"], name: "index_variant_overrides_on_variant_id_and_hub_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "variant_overrides", ["variant_id", "hub_id"], name: "index_variant_overrides_on_variant_id_and_hub_id", using: :btree
|
||||
|
||||
create_table "versions", force: :cascade do |t|
|
||||
t.string "item_type", limit: 255, null: false
|
||||
t.integer "item_id", null: false
|
||||
@@ -1207,10 +1144,9 @@ ActiveRecord::Schema.define(version: 20210216203057) do
|
||||
t.text "object"
|
||||
t.datetime "created_at"
|
||||
t.text "custom_data"
|
||||
t.index ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id", using: :btree
|
||||
end
|
||||
|
||||
add_index "versions", ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id", using: :btree
|
||||
|
||||
add_foreign_key "adjustment_metadata", "enterprises", name: "adjustment_metadata_enterprise_id_fk"
|
||||
add_foreign_key "adjustment_metadata", "spree_adjustments", column: "adjustment_id", name: "adjustment_metadata_adjustment_id_fk", on_delete: :cascade
|
||||
add_foreign_key "coordinator_fees", "enterprise_fees", name: "coordinator_fees_enterprise_fee_id_fk"
|
||||
|
||||
Reference in New Issue
Block a user