From b23ce204887cf7f36f86c8f243b26dc06208484d Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Thu, 21 Mar 2019 21:48:38 +0100 Subject: [PATCH] Add migration from spree v2.1 --- ...818_add_deleted_at_to_spree_stock_items.rb | 5 + db/schema.rb | 1021 +++++++++-------- 2 files changed, 518 insertions(+), 508 deletions(-) create mode 100644 db/migrate/20190321203818_add_deleted_at_to_spree_stock_items.rb diff --git a/db/migrate/20190321203818_add_deleted_at_to_spree_stock_items.rb b/db/migrate/20190321203818_add_deleted_at_to_spree_stock_items.rb new file mode 100644 index 0000000000..3170545118 --- /dev/null +++ b/db/migrate/20190321203818_add_deleted_at_to_spree_stock_items.rb @@ -0,0 +1,5 @@ +class AddDeletedAtToSpreeStockItems < ActiveRecord::Migration + def up + add_column :spree_stock_items, :deleted_at, :datetime + end +end diff --git a/db/schema.rb b/db/schema.rb index 288c838266..3aa6f812b0 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -9,11 +9,14 @@ # from scratch. The latter is a flawed and unsustainable approach (the more migrations # you'll amass, the slower it'll run and the greater likelihood for issues). # -# It's strongly recommended to check this file into your version control system. +# It's strongly recommended that you check this file into your version control system. ActiveRecord::Schema.define(:version => 20191023172424) do - create_table "adjustment_metadata", :force => true do |t| + # These are extensions that must be enabled in order to support this database + enable_extension "plpgsql" + + create_table "adjustment_metadata", force: true do |t| t.integer "adjustment_id" t.integer "enterprise_id" t.string "fee_name" @@ -21,95 +24,95 @@ ActiveRecord::Schema.define(:version => 20191023172424) do t.string "enterprise_role" end - add_index "adjustment_metadata", ["adjustment_id"], :name => "index_adjustment_metadata_on_adjustment_id" - add_index "adjustment_metadata", ["enterprise_id"], :name => "index_adjustment_metadata_on_enterprise_id" + 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 => true do |t| - t.integer "user_id", :null => false - t.string "action_name", :null => false - t.string "column_name", :null => false - t.boolean "visible", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + create_table "column_preferences", force: true do |t| + t.integer "user_id", null: false + t.string "action_name", null: false + t.string "column_name", null: false + t.boolean "visible", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false 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 + 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 => true do |t| + create_table "coordinator_fees", force: true do |t| t.integer "order_cycle_id" t.integer "enterprise_fee_id" end - add_index "coordinator_fees", ["enterprise_fee_id"], :name => "index_coordinator_fees_on_enterprise_fee_id" - add_index "coordinator_fees", ["order_cycle_id"], :name => "index_coordinator_fees_on_order_cycle_id" + 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 => true do |t| - t.string "email", :null => false - t.integer "enterprise_id", :null => false + create_table "customers", force: true do |t| + t.string "email", null: false + t.integer "enterprise_id", null: false t.string "code" 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.integer "bill_address_id" t.integer "ship_address_id" t.string "name" - t.boolean "allow_charges", :default => false, :null => false + t.boolean "allow_charges", default: false, null: false end - add_index "customers", ["bill_address_id"], :name => "index_customers_on_bill_address_id" - add_index "customers", ["email"], :name => "index_customers_on_email" - add_index "customers", ["enterprise_id", "code"], :name => "index_customers_on_enterprise_id_and_code", :unique => true - add_index "customers", ["ship_address_id"], :name => "index_customers_on_ship_address_id" - add_index "customers", ["user_id"], :name => "index_customers_on_user_id" + 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 => true do |t| - t.integer "priority", :default => 0, :null => false - t.integer "attempts", :default => 0, :null => false - t.text "handler", :null => false + create_table "delayed_jobs", force: true do |t| + t.integer "priority", default: 0, null: false + t.integer "attempts", default: 0, null: false + t.text "handler", null: false t.text "last_error" t.datetime "run_at" t.datetime "locked_at" t.datetime "failed_at" t.string "locked_by" t.string "queue" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" + add_index "delayed_jobs", ["priority", "run_at"], name: "delayed_jobs_priority", using: :btree - create_table "distributors_payment_methods", :id => false, :force => true do |t| + create_table "distributors_payment_methods", id: false, force: true do |t| t.integer "distributor_id" t.integer "payment_method_id" end - add_index "distributors_payment_methods", ["distributor_id"], :name => "index_distributors_payment_methods_on_distributor_id" - add_index "distributors_payment_methods", ["payment_method_id"], :name => "index_distributors_payment_methods_on_payment_method_id" + 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 => true do |t| + create_table "distributors_shipping_methods", force: true do |t| t.integer "distributor_id" t.integer "shipping_method_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 end - add_index "distributors_shipping_methods", ["distributor_id"], :name => "index_distributors_shipping_methods_on_distributor_id" - add_index "distributors_shipping_methods", ["shipping_method_id"], :name => "index_distributors_shipping_methods_on_shipping_method_id" + 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 => true do |t| + create_table "enterprise_fees", force: true do |t| t.integer "enterprise_id" t.string "fee_type" t.string "name" - 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 "tax_category_id" - t.boolean "inherits_tax_category", :default => false, :null => false + t.boolean "inherits_tax_category", default: false, null: false end - add_index "enterprise_fees", ["enterprise_id"], :name => "index_enterprise_fees_on_enterprise_id" - add_index "enterprise_fees", ["tax_category_id"], :name => "index_enterprise_fees_on_tax_category_id" + 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 => true do |t| + create_table "enterprise_groups", force: true do |t| t.string "name" t.boolean "on_front_page" t.integer "position" @@ -124,56 +127,56 @@ ActiveRecord::Schema.define(:version => 20191023172424) do t.integer "logo_file_size" t.datetime "logo_updated_at" t.integer "address_id" - t.string "email", :default => "", :null => false - t.string "website", :default => "", :null => false - t.string "facebook", :default => "", :null => false - t.string "instagram", :default => "", :null => false - t.string "linkedin", :default => "", :null => false - t.string "twitter", :default => "", :null => false + t.string "email", default: "", null: false + t.string "website", default: "", null: false + t.string "facebook", default: "", null: false + t.string "instagram", default: "", null: false + t.string "linkedin", default: "", null: false + t.string "twitter", default: "", null: false t.integer "owner_id" - t.string "permalink", :null => false + t.string "permalink", null: false end - add_index "enterprise_groups", ["address_id"], :name => "index_enterprise_groups_on_address_id" - add_index "enterprise_groups", ["owner_id"], :name => "index_enterprise_groups_on_owner_id" - add_index "enterprise_groups", ["permalink"], :name => "index_enterprise_groups_on_permalink", :unique => true + 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 => true do |t| + create_table "enterprise_groups_enterprises", id: false, force: true do |t| t.integer "enterprise_group_id" t.integer "enterprise_id" end - add_index "enterprise_groups_enterprises", ["enterprise_group_id"], :name => "index_enterprise_groups_enterprises_on_enterprise_group_id" - add_index "enterprise_groups_enterprises", ["enterprise_id"], :name => "index_enterprise_groups_enterprises_on_enterprise_id" + 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 => true do |t| + create_table "enterprise_relationship_permissions", force: true do |t| t.integer "enterprise_relationship_id" - t.string "name", :null => false + t.string "name", null: false end - add_index "enterprise_relationship_permissions", ["enterprise_relationship_id"], :name => "index_erp_on_erid" + add_index "enterprise_relationship_permissions", ["enterprise_relationship_id"], name: "index_erp_on_erid", using: :btree - create_table "enterprise_relationships", :force => true do |t| + create_table "enterprise_relationships", force: true do |t| t.integer "parent_id" t.integer "child_id" end - add_index "enterprise_relationships", ["child_id"], :name => "index_enterprise_relationships_on_child_id" - add_index "enterprise_relationships", ["parent_id", "child_id"], :name => "index_enterprise_relationships_on_parent_id_and_child_id", :unique => true - add_index "enterprise_relationships", ["parent_id"], :name => "index_enterprise_relationships_on_parent_id" + 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 => true do |t| + create_table "enterprise_roles", force: true do |t| t.integer "user_id" t.integer "enterprise_id" - t.boolean "receives_notifications", :default => false + t.boolean "receives_notifications", default: false end - add_index "enterprise_roles", ["enterprise_id", "user_id"], :name => "index_enterprise_roles_on_enterprise_id_and_user_id", :unique => true - add_index "enterprise_roles", ["enterprise_id"], :name => "index_enterprise_roles_on_enterprise_id" - add_index "enterprise_roles", ["user_id", "enterprise_id"], :name => "index_enterprise_roles_on_user_id_and_enterprise_id", :unique => true - add_index "enterprise_roles", ["user_id"], :name => "index_enterprise_roles_on_user_id" + 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 => true do |t| + create_table "enterprises", force: true do |t| t.string "name" t.text "description" t.text "long_description" @@ -187,8 +190,8 @@ ActiveRecord::Schema.define(:version => 20191023172424) do t.integer "address_id" t.text "pickup_times" t.string "next_collection_at" - 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.text "distributor_info" t.string "logo_file_name" t.string "logo_content_type" @@ -198,139 +201,139 @@ ActiveRecord::Schema.define(:version => 20191023172424) do t.string "promo_image_content_type" t.integer "promo_image_file_size" t.datetime "promo_image_updated_at" - t.boolean "visible", :default => true + t.boolean "visible", default: true t.string "facebook" t.string "instagram" t.string "linkedin" - t.integer "owner_id", :null => false - t.string "sells", :default => "none", :null => false - t.boolean "producer_profile_only", :default => false - t.string "permalink", :null => false - t.boolean "charges_sales_tax", :default => false, :null => false + t.integer "owner_id", null: false + t.string "sells", default: "none", null: false + t.boolean "producer_profile_only", default: false + t.string "permalink", null: false + t.boolean "charges_sales_tax", default: false, null: false t.string "email_address" - t.boolean "require_login", :default => false, :null => false - t.boolean "allow_guest_orders", :default => true, :null => false + t.boolean "require_login", default: false, null: false + t.boolean "allow_guest_orders", default: true, null: false t.text "invoice_text" - t.boolean "display_invoice_logo", :default => false - t.boolean "allow_order_changes", :default => false, :null => false - t.boolean "enable_subscriptions", :default => false, :null => false + t.boolean "display_invoice_logo", default: false + t.boolean "allow_order_changes", default: false, null: false + t.boolean "enable_subscriptions", default: false, null: false end - add_index "enterprises", ["address_id"], :name => "index_enterprises_on_address_id" - add_index "enterprises", ["is_primary_producer", "sells"], :name => "index_enterprises_on_is_primary_producer_and_sells" - add_index "enterprises", ["name"], :name => "index_enterprises_on_name", :unique => true - add_index "enterprises", ["owner_id"], :name => "index_enterprises_on_owner_id" - add_index "enterprises", ["permalink"], :name => "index_enterprises_on_permalink", :unique => true - add_index "enterprises", ["sells"], :name => "index_enterprises_on_sells" + 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 => true do |t| + create_table "exchange_fees", force: true do |t| t.integer "exchange_id" t.integer "enterprise_fee_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 end - add_index "exchange_fees", ["enterprise_fee_id"], :name => "index_exchange_fees_on_enterprise_fee_id" - add_index "exchange_fees", ["exchange_id"], :name => "index_exchange_fees_on_exchange_id" + 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 => true do |t| + create_table "exchange_variants", force: true do |t| t.integer "exchange_id" t.integer "variant_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 end - add_index "exchange_variants", ["exchange_id"], :name => "index_exchange_variants_on_exchange_id" - add_index "exchange_variants", ["variant_id"], :name => "index_exchange_variants_on_variant_id" + 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 => true do |t| + create_table "exchanges", force: true do |t| t.integer "order_cycle_id" t.integer "sender_id" t.integer "receiver_id" t.text "pickup_time" t.text "pickup_instructions" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "incoming", :default => false, :null => false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "incoming", default: false, null: false t.text "receival_instructions" end - add_index "exchanges", ["order_cycle_id"], :name => "index_exchanges_on_order_cycle_id" - add_index "exchanges", ["receiver_id"], :name => "index_exchanges_on_receiver_id" - add_index "exchanges", ["sender_id"], :name => "index_exchanges_on_sender_id" + 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 => true 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 + create_table "inventory_items", force: true 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 end - add_index "inventory_items", ["enterprise_id", "variant_id"], :name => "index_inventory_items_on_enterprise_id_and_variant_id", :unique => true + 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 => true do |t| - t.integer "order_cycle_id", :null => false - t.integer "schedule_id", :null => false + create_table "order_cycle_schedules", force: true do |t| + t.integer "order_cycle_id", null: false + t.integer "schedule_id", null: false end - add_index "order_cycle_schedules", ["order_cycle_id"], :name => "index_order_cycle_schedules_on_order_cycle_id" - add_index "order_cycle_schedules", ["schedule_id"], :name => "index_order_cycle_schedules_on_schedule_id" + 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 => true do |t| + create_table "order_cycles", force: true do |t| t.string "name" t.datetime "orders_open_at" t.datetime "orders_close_at" t.integer "coordinator_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 end - create_table "producer_properties", :force => true do |t| + create_table "producer_properties", force: true do |t| t.string "value" t.integer "producer_id" t.integer "property_id" - t.integer "position", :default => 0, :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.integer "position", default: 0, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - add_index "producer_properties", ["position"], :name => "index_producer_properties_on_position" - add_index "producer_properties", ["producer_id"], :name => "index_producer_properties_on_producer_id" - add_index "producer_properties", ["property_id"], :name => "index_producer_properties_on_property_id" + 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 => true do |t| - t.integer "subscription_id", :null => false + create_table "proxy_orders", force: true do |t| + t.integer "subscription_id", null: false t.integer "order_id" t.datetime "canceled_at" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "order_cycle_id", :null => false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "order_cycle_id", null: false t.datetime "placed_at" t.datetime "confirmed_at" end - add_index "proxy_orders", ["order_cycle_id", "subscription_id"], :name => "index_proxy_orders_on_order_cycle_id_and_subscription_id", :unique => true - add_index "proxy_orders", ["order_id"], :name => "index_proxy_orders_on_order_id", :unique => true - add_index "proxy_orders", ["subscription_id"], :name => "index_proxy_orders_on_subscription_id" + 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 => true do |t| - t.string "name", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + create_table "schedules", force: true do |t| + t.string "name", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table "sessions", :force => true do |t| - t.string "session_id", :null => false + create_table "sessions", force: true do |t| + t.string "session_id", null: false t.text "data" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id" - add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at" + 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 => true do |t| + create_table "spree_activators", force: true do |t| t.string "description" t.datetime "expires_at" t.datetime "created_at" @@ -340,13 +343,13 @@ ActiveRecord::Schema.define(:version => 20191023172424) do t.string "event_name" t.string "type" t.integer "usage_limit" - t.string "match_policy", :default => "all" + t.string "match_policy", default: "all" t.string "code" - t.boolean "advertise", :default => false + t.boolean "advertise", default: false t.string "path" end - create_table "spree_addresses", :force => true do |t| + create_table "spree_addresses", force: true do |t| t.string "firstname" t.string "lastname" t.string "address1" @@ -358,79 +361,79 @@ ActiveRecord::Schema.define(:version => 20191023172424) do t.string "alternative_phone" t.integer "state_id" t.integer "country_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.string "company" t.float "latitude" t.float "longitude" end - add_index "spree_addresses", ["firstname"], :name => "index_addresses_on_firstname" - add_index "spree_addresses", ["lastname"], :name => "index_addresses_on_lastname" + 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 => true do |t| + create_table "spree_adjustments", force: true do |t| t.integer "source_id" - t.decimal "amount", :precision => 10, :scale => 2 + t.decimal "amount", precision: 10, scale: 2 t.string "label" t.string "source_type" t.integer "adjustable_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.boolean "mandatory" t.integer "originator_id" t.string "originator_type" - t.boolean "eligible", :default => true + t.boolean "eligible", default: true t.string "adjustable_type" - 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" end - add_index "spree_adjustments", ["adjustable_id"], :name => "index_adjustments_on_order_id" + add_index "spree_adjustments", ["adjustable_id"], name: "index_adjustments_on_order_id", using: :btree - create_table "spree_assets", :force => true do |t| + create_table "spree_assets", force: true do |t| t.integer "viewable_id" t.integer "attachment_width" t.integer "attachment_height" t.integer "attachment_file_size" t.integer "position" - t.string "viewable_type", :limit => 50 + t.string "viewable_type", limit: 50 t.string "attachment_content_type" t.string "attachment_file_name" - t.string "type", :limit => 75 + t.string "type", limit: 75 t.datetime "attachment_updated_at" t.text "alt" end - add_index "spree_assets", ["viewable_id"], :name => "index_assets_on_viewable_id" - add_index "spree_assets", ["viewable_type", "type"], :name => "index_assets_on_viewable_type_and_type" + 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 => true do |t| + create_table "spree_calculators", force: true do |t| t.string "type" - t.integer "calculable_id", :null => false - t.string "calculable_type", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.integer "calculable_id", null: false + t.string "calculable_type", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table "spree_configurations", :force => true do |t| + create_table "spree_configurations", force: true do |t| t.string "name" - t.string "type", :limit => 50 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.string "type", limit: 50 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - add_index "spree_configurations", ["name", "type"], :name => "index_configurations_on_name_and_type" + add_index "spree_configurations", ["name", "type"], name: "index_configurations_on_name_and_type", using: :btree - create_table "spree_countries", :force => true do |t| + create_table "spree_countries", force: true do |t| t.string "iso_name" t.string "iso" t.string "iso3" t.string "name" t.integer "numcode" - t.boolean "states_required", :default => true + t.boolean "states_required", default: true end - create_table "spree_credit_cards", :force => true do |t| + create_table "spree_credit_cards", force: true do |t| t.string "month" t.string "year" t.string "cc_type" @@ -441,123 +444,123 @@ ActiveRecord::Schema.define(:version => 20191023172424) do t.string "start_year" t.string "issue_number" t.integer "address_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.string "gateway_customer_profile_id" t.string "gateway_payment_profile_id" t.integer "user_id" t.integer "payment_method_id" - t.boolean "is_default", :default => false + t.boolean "is_default", default: false end - add_index "spree_credit_cards", ["payment_method_id"], :name => "index_spree_credit_cards_on_payment_method_id" - add_index "spree_credit_cards", ["user_id"], :name => "index_spree_credit_cards_on_user_id" + 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 => true do |t| + create_table "spree_gateways", force: true do |t| t.string "type" t.string "name" t.text "description" - t.boolean "active", :default => true - t.string "environment", :default => "development" - t.string "server", :default => "test" - t.boolean "test_mode", :default => true - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.boolean "active", default: true + t.string "environment", default: "development" + t.string "server", default: "test" + t.boolean "test_mode", default: true + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table "spree_inventory_units", :force => true do |t| + create_table "spree_inventory_units", force: true do |t| t.string "state" t.integer "variant_id" 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 "shipment_id" t.integer "return_authorization_id" - t.boolean "pending", :default => true + t.boolean "pending", default: true end - add_index "spree_inventory_units", ["order_id"], :name => "index_inventory_units_on_order_id" - add_index "spree_inventory_units", ["shipment_id"], :name => "index_inventory_units_on_shipment_id" - add_index "spree_inventory_units", ["variant_id"], :name => "index_inventory_units_on_variant_id" + 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 => true do |t| + create_table "spree_line_items", force: true do |t| t.integer "order_id" t.integer "variant_id" - t.integer "quantity", :null => false - t.decimal "price", :precision => 8, :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: 8, scale: 2, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.integer "max_quantity" t.string "currency" - t.decimal "distribution_fee", :precision => 10, :scale => 2 - t.decimal "final_weight_volume", :precision => 10, :scale => 2 - t.decimal "cost_price", :precision => 8, :scale => 2 + t.decimal "distribution_fee", precision: 10, scale: 2 + t.decimal "final_weight_volume", precision: 10, scale: 2 + t.decimal "cost_price", precision: 8, scale: 2 t.integer "tax_category_id" end - add_index "spree_line_items", ["order_id"], :name => "index_line_items_on_order_id" - add_index "spree_line_items", ["variant_id"], :name => "index_line_items_on_variant_id" + 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 => true do |t| + create_table "spree_log_entries", force: true do |t| t.integer "source_id" t.string "source_type" t.text "details" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table "spree_mail_methods", :force => true do |t| + create_table "spree_mail_methods", force: true do |t| t.string "environment" - t.boolean "active", :default => true - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.boolean "active", default: true + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table "spree_option_types", :force => true do |t| - t.string "name", :limit => 100 - t.string "presentation", :limit => 100 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "position", :default => 0, :null => false + create_table "spree_option_types", force: true do |t| + t.string "name", limit: 100 + t.string "presentation", limit: 100 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "position", default: 0, null: false end - create_table "spree_option_values", :force => true do |t| + create_table "spree_option_values", force: true do |t| t.integer "position" t.string "name" t.string "presentation" t.integer "option_type_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 end - create_table "spree_option_values_line_items", :id => false, :force => true do |t| + create_table "spree_option_values_line_items", id: false, force: true do |t| t.integer "line_item_id" t.integer "option_value_id" end - add_index "spree_option_values_line_items", ["line_item_id"], :name => "index_option_values_line_items_on_line_item_id" + 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 => true do |t| + create_table "spree_option_values_variants", id: false, force: true do |t| t.integer "variant_id" t.integer "option_value_id" end - add_index "spree_option_values_variants", ["variant_id", "option_value_id"], :name => "index_option_values_variants_on_variant_id_and_option_value_id" - add_index "spree_option_values_variants", ["variant_id"], :name => "index_option_values_variants_on_variant_id" + 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 => true 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 + create_table "spree_orders", force: true 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.string "state" - 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" t.string "payment_state" t.string "email" @@ -570,29 +573,30 @@ ActiveRecord::Schema.define(:version => 20191023172424) do t.integer "created_by_id" 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" - add_index "spree_orders", ["customer_id"], :name => "index_spree_orders_on_customer_id" - add_index "spree_orders", ["distributor_id"], :name => "index_spree_orders_on_distributor_id" - add_index "spree_orders", ["number"], :name => "index_orders_on_number" - add_index "spree_orders", ["order_cycle_id"], :name => "index_spree_orders_on_order_cycle_id" + 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", ["number"], name: "index_orders_on_number", using: :btree + add_index "spree_orders", ["distributor_id"], name: "index_spree_orders_on_distributor_id", using: :btree + add_index "spree_orders", ["order_cycle_id"], name: "index_spree_orders_on_order_cycle_id", using: :btree - create_table "spree_payment_methods", :force => true do |t| + + create_table "spree_payment_methods", force: true do |t| t.string "type" t.string "name" t.text "description" - t.boolean "active", :default => true - t.string "environment", :default => "development" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.boolean "active", default: true + t.string "environment", default: "development" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.datetime "deleted_at" t.string "display_on" end - create_table "spree_payments", :force => true do |t| - t.decimal "amount", :precision => 10, :scale => 2, :default => 0.0, :null => false + create_table "spree_payments", force: true do |t| + 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" t.integer "payment_method_id" @@ -604,99 +608,99 @@ ActiveRecord::Schema.define(:version => 20191023172424) do t.string "cvv_response_message" end - add_index "spree_payments", ["order_id"], :name => "index_spree_payments_on_order_id" + add_index "spree_payments", ["order_id"], name: "index_spree_payments_on_order_id", using: :btree - create_table "spree_paypal_accounts", :force => true do |t| + create_table "spree_paypal_accounts", force: true do |t| t.string "email" t.string "payer_id" t.string "payer_country" t.string "payer_status" end - create_table "spree_paypal_express_checkouts", :force => true do |t| + create_table "spree_paypal_express_checkouts", force: true do |t| t.string "token" t.string "payer_id" t.string "transaction_id" - t.string "state", :default => "complete" + t.string "state", default: "complete" t.string "refund_transaction_id" t.datetime "refunded_at" t.string "refund_type" t.datetime "created_at" end - add_index "spree_paypal_express_checkouts", ["transaction_id"], :name => "index_spree_paypal_express_checkouts_on_transaction_id" + 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 => true do |t| + create_table "spree_pending_promotions", force: true do |t| t.integer "user_id" t.integer "promotion_id" end - add_index "spree_pending_promotions", ["promotion_id"], :name => "index_spree_pending_promotions_on_promotion_id" - add_index "spree_pending_promotions", ["user_id"], :name => "index_spree_pending_promotions_on_user_id" + 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 => true do |t| + create_table "spree_preferences", force: true do |t| t.text "value" - 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.string "key" t.string "value_type" end - add_index "spree_preferences", ["key"], :name => "index_spree_preferences_on_key", :unique => true + add_index "spree_preferences", ["key"], name: "index_spree_preferences_on_key", unique: true, using: :btree - create_table "spree_prices", :force => true do |t| - t.integer "variant_id", :null => false - t.decimal "amount", :precision => 8, :scale => 2 - t.string "currency" + create_table "spree_prices", force: true do |t| + t.integer "variant_id", null: false + t.decimal "amount", precision: 8, scale: 2 + t.string "currency" t.datetime "deleted_at" end - add_index "spree_prices", ["variant_id"], :name => "index_spree_prices_on_variant_id" + add_index "spree_prices", ["variant_id"], name: "index_spree_prices_on_variant_id", using: :btree - create_table "spree_product_groups", :force => true do |t| + create_table "spree_product_groups", force: true do |t| t.string "name" t.string "permalink" t.string "order" end - add_index "spree_product_groups", ["name"], :name => "index_product_groups_on_name" - add_index "spree_product_groups", ["permalink"], :name => "index_product_groups_on_permalink" + 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 => true do |t| + create_table "spree_product_groups_products", id: false, force: true do |t| t.integer "product_id" t.integer "product_group_id" end - create_table "spree_product_option_types", :force => true do |t| + create_table "spree_product_option_types", force: true do |t| t.integer "position" t.integer "product_id" t.integer "option_type_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 end - create_table "spree_product_properties", :force => true do |t| + create_table "spree_product_properties", force: true do |t| t.string "value" t.integer "product_id" t.integer "property_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "position", :default => 0 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "position", default: 0 end - add_index "spree_product_properties", ["product_id"], :name => "index_product_properties_on_product_id" + add_index "spree_product_properties", ["product_id"], name: "index_product_properties_on_product_id", using: :btree - create_table "spree_product_scopes", :force => true do |t| + create_table "spree_product_scopes", force: true do |t| t.string "name" t.text "arguments" t.integer "product_group_id" end - add_index "spree_product_scopes", ["name"], :name => "index_product_scopes_on_name" - add_index "spree_product_scopes", ["product_group_id"], :name => "index_product_scopes_on_product_group_id" + 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 => true do |t| - t.string "name", :default => "", :null => false + create_table "spree_products", force: true do |t| + t.string "name", default: "", null: false t.text "description" t.datetime "available_on" t.datetime "deleted_at" @@ -705,8 +709,8 @@ ActiveRecord::Schema.define(:version => 20191023172424) do t.string "meta_keywords" t.integer "tax_category_id" t.integer "shipping_category_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 "supplier_id" t.boolean "group_buy" t.float "group_buy_unit_size" @@ -714,200 +718,201 @@ ActiveRecord::Schema.define(:version => 20191023172424) do t.float "variant_unit_scale" t.string "variant_unit_name" t.text "notes" - t.integer "primary_taxon_id", :null => false - t.boolean "inherits_properties", :default => true, :null => false + t.integer "primary_taxon_id", null: false + t.boolean "inherits_properties", default: true, null: false end - add_index "spree_products", ["available_on"], :name => "index_products_on_available_on" - add_index "spree_products", ["deleted_at"], :name => "index_products_on_deleted_at" - add_index "spree_products", ["name"], :name => "index_products_on_name" - add_index "spree_products", ["permalink"], :name => "index_products_on_permalink" - add_index "spree_products", ["permalink"], :name => "permalink_idx_unique", :unique => true - add_index "spree_products", ["primary_taxon_id"], :name => "index_spree_products_on_primary_taxon_id" + 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 - create_table "spree_products_promotion_rules", :id => false, :force => true do |t| + create_table "spree_products_promotion_rules", id: false, force: true do |t| t.integer "product_id" t.integer "promotion_rule_id" end - add_index "spree_products_promotion_rules", ["product_id"], :name => "index_products_promotion_rules_on_product_id" - add_index "spree_products_promotion_rules", ["promotion_rule_id"], :name => "index_products_promotion_rules_on_promotion_rule_id" + 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 => true do |t| + create_table "spree_products_taxons", force: true do |t| t.integer "product_id" t.integer "taxon_id" end - add_index "spree_products_taxons", ["product_id"], :name => "index_products_taxons_on_product_id" - add_index "spree_products_taxons", ["taxon_id"], :name => "index_products_taxons_on_taxon_id" + 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 => true do |t| + create_table "spree_promotion_action_line_items", force: true do |t| t.integer "promotion_action_id" t.integer "variant_id" - t.integer "quantity", :default => 1 + t.integer "quantity", default: 1 end - create_table "spree_promotion_actions", :force => true do |t| + create_table "spree_promotion_actions", force: true do |t| t.integer "activator_id" t.integer "position" t.string "type" end - create_table "spree_promotion_rules", :force => true do |t| + create_table "spree_promotion_rules", force: true do |t| t.integer "activator_id" t.integer "user_id" t.integer "product_group_id" t.string "type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - add_index "spree_promotion_rules", ["product_group_id"], :name => "index_promotion_rules_on_product_group_id" - add_index "spree_promotion_rules", ["user_id"], :name => "index_promotion_rules_on_user_id" + 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 => true do |t| + create_table "spree_promotion_rules_users", id: false, force: true do |t| t.integer "user_id" t.integer "promotion_rule_id" end - add_index "spree_promotion_rules_users", ["promotion_rule_id"], :name => "index_promotion_rules_users_on_promotion_rule_id" - add_index "spree_promotion_rules_users", ["user_id"], :name => "index_promotion_rules_users_on_user_id" + 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 => true do |t| + create_table "spree_properties", force: true do |t| t.string "name" - t.string "presentation", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.string "presentation", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table "spree_return_authorizations", :force => true do |t| + create_table "spree_return_authorizations", force: true do |t| t.string "number" t.string "state" - 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 - create_table "spree_roles", :force => true do |t| + create_table "spree_roles", force: true do |t| t.string "name" end - create_table "spree_roles_users", :id => false, :force => true do |t| + create_table "spree_roles_users", id: false, force: true do |t| t.integer "role_id" t.integer "user_id" end - add_index "spree_roles_users", ["role_id"], :name => "index_roles_users_on_role_id" - add_index "spree_roles_users", ["user_id"], :name => "index_roles_users_on_user_id" + 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 => true do |t| + create_table "spree_shipments", force: true do |t| t.string "tracking" t.string "number" - t.decimal "cost", :precision => 8, :scale => 2 + t.decimal "cost", precision: 8, scale: 2 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.datetime "created_at", null: false + t.datetime "updated_at", null: false t.string "state" t.integer "stock_location_id" end - add_index "spree_shipments", ["number"], :name => "index_shipments_on_number" - add_index "spree_shipments", ["order_id"], :name => "index_spree_shipments_on_order_id", :unique => true + 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 => true do |t| + create_table "spree_shipping_categories", force: true do |t| t.string "name" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "temperature_controlled", :default => false, :null => false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "temperature_controlled", default: false, null: false end - create_table "spree_shipping_method_categories", :force => true do |t| - t.integer "shipping_method_id", :null => false - t.integer "shipping_category_id", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + create_table "spree_shipping_method_categories", force: true do |t| + t.integer "shipping_method_id", null: false + t.integer "shipping_category_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - add_index "spree_shipping_method_categories", ["shipping_category_id"], :name => "index_spree_shipping_method_categories_on_shipping_category_id" - add_index "spree_shipping_method_categories", ["shipping_method_id"], :name => "index_spree_shipping_method_categories_on_shipping_method_id" + 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 => true do |t| + create_table "spree_shipping_methods", force: true do |t| t.string "name" - 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.string "display_on" t.datetime "deleted_at" - t.boolean "require_ship_address", :default => true + t.boolean "require_ship_address", default: true t.text "description" t.string "tracking_url" end - create_table "spree_shipping_methods_zones", :id => false, :force => true do |t| + create_table "spree_shipping_methods_zones", id: false, force: true do |t| t.integer "shipping_method_id" t.integer "zone_id" end - create_table "spree_shipping_rates", :force => true do |t| + create_table "spree_shipping_rates", force: true do |t| t.integer "shipment_id" t.integer "shipping_method_id" - t.boolean "selected", :default => false - t.decimal "cost", :precision => 8, :scale => 2, :default => 0.0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.boolean "selected", default: false + t.decimal "cost", precision: 8, scale: 2, default: 0.0 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - add_index "spree_shipping_rates", ["shipment_id", "shipping_method_id"], :name => "spree_shipping_rates_join_index", :unique => true + 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 => true do |t| + create_table "spree_skrill_transactions", force: true do |t| t.string "email" t.float "amount" t.string "currency" t.integer "transaction_id" t.integer "customer_id" t.string "payment_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table "spree_state_changes", :force => true do |t| + create_table "spree_state_changes", force: true do |t| t.string "name" t.string "previous_state" t.integer "stateful_id" 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.string "stateful_type" t.string "next_state" end - create_table "spree_states", :force => true do |t| + create_table "spree_states", force: true do |t| t.string "name" t.string "abbr" t.integer "country_id" end - create_table "spree_stock_items", :force => true do |t| + create_table "spree_stock_items", force: true do |t| t.integer "stock_location_id" t.integer "variant_id" - t.integer "count_on_hand", :default => 0, :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "backorderable", :default => false + t.integer "count_on_hand", default: 0, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "backorderable", default: false + t.datetime "deleted_at" end - add_index "spree_stock_items", ["stock_location_id", "variant_id"], :name => "stock_item_by_loc_and_var_id" - add_index "spree_stock_items", ["stock_location_id"], :name => "index_spree_stock_items_on_stock_location_id" - add_index "spree_stock_items", ["variant_id"], :name => "index_spree_stock_items_on_variant_id", :unique => true + 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 => true do |t| + create_table "spree_stock_locations", force: true do |t| t.string "name" - 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.string "address1" t.string "address2" t.string "city" @@ -916,73 +921,73 @@ ActiveRecord::Schema.define(:version => 20191023172424) do t.integer "country_id" t.string "zipcode" t.string "phone" - t.boolean "active", :default => true - t.boolean "backorderable_default", :default => false - t.boolean "propagate_all_variants", :default => true + t.boolean "active", default: true + t.boolean "backorderable_default", default: false + t.boolean "propagate_all_variants", default: true end - create_table "spree_stock_movements", :force => true do |t| + create_table "spree_stock_movements", force: true do |t| t.integer "stock_item_id" - t.integer "quantity", :default => 0 + t.integer "quantity", default: 0 t.string "action" - 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 "originator_id" t.string "originator_type" end - add_index "spree_stock_movements", ["stock_item_id"], :name => "index_spree_stock_movements_on_stock_item_id" + 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 => true do |t| + create_table "spree_stock_transfers", force: true do |t| t.string "type" t.string "reference" t.integer "source_location_id" t.integer "destination_location_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.string "number" end - add_index "spree_stock_transfers", ["destination_location_id"], :name => "index_spree_stock_transfers_on_destination_location_id" - add_index "spree_stock_transfers", ["number"], :name => "index_spree_stock_transfers_on_number" - add_index "spree_stock_transfers", ["source_location_id"], :name => "index_spree_stock_transfers_on_source_location_id" + 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 => true do |t| + create_table "spree_tax_categories", force: true do |t| t.string "name" t.string "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "is_default", :default => false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "is_default", default: false t.datetime "deleted_at" end - create_table "spree_tax_rates", :force => true do |t| - t.decimal "amount", :precision => 8, :scale => 5 + create_table "spree_tax_rates", force: true do |t| + t.decimal "amount", precision: 8, scale: 5 t.integer "zone_id" t.integer "tax_category_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "included_in_price", :default => false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "included_in_price", default: false t.string "name" - t.boolean "show_rate_in_label", :default => true + t.boolean "show_rate_in_label", default: true t.datetime "deleted_at" end - create_table "spree_taxonomies", :force => true do |t| - t.string "name", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "position", :default => 0 + create_table "spree_taxonomies", force: true do |t| + t.string "name", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "position", default: 0 end - create_table "spree_taxons", :force => true do |t| + create_table "spree_taxons", force: true do |t| t.integer "parent_id" - t.integer "position", :default => 0 - t.string "name", :null => false + t.integer "position", default: 0 + t.string "name", null: false t.string "permalink" t.integer "taxonomy_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 "lft" t.integer "rgt" t.string "icon_file_name" @@ -995,29 +1000,29 @@ ActiveRecord::Schema.define(:version => 20191023172424) do t.string "meta_keywords" end - add_index "spree_taxons", ["parent_id"], :name => "index_taxons_on_parent_id" - add_index "spree_taxons", ["permalink"], :name => "index_taxons_on_permalink" - add_index "spree_taxons", ["taxonomy_id"], :name => "index_taxons_on_taxonomy_id" + 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 => true do |t| + create_table "spree_tokenized_permissions", force: true do |t| t.integer "permissable_id" t.string "permissable_type" t.string "token" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - add_index "spree_tokenized_permissions", ["permissable_id", "permissable_type"], :name => "index_tokenized_name_and_type" + add_index "spree_tokenized_permissions", ["permissable_id", "permissable_type"], name: "index_tokenized_name_and_type", using: :btree - create_table "spree_trackers", :force => true do |t| + create_table "spree_trackers", force: true do |t| t.string "environment" t.string "analytics_id" - t.boolean "active", :default => true - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.boolean "active", default: true + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table "spree_users", :force => true do |t| + create_table "spree_users", force: true do |t| t.string "encrypted_password" t.string "password_salt" t.string "email" @@ -1025,8 +1030,8 @@ ActiveRecord::Schema.define(:version => 20191023172424) do t.string "persistence_token" t.string "reset_password_token" t.string "perishable_token" - t.integer "sign_in_count", :default => 0, :null => false - t.integer "failed_attempts", :default => 0, :null => false + t.integer "sign_in_count", default: 0, null: false + t.integer "failed_attempts", default: 0, null: false t.datetime "last_request_at" t.datetime "current_sign_in_at" t.datetime "last_sign_in_at" @@ -1035,115 +1040,115 @@ ActiveRecord::Schema.define(:version => 20191023172424) do t.string "login" t.integer "ship_address_id" t.integer "bill_address_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.string "authentication_token" t.string "unlock_token" t.datetime "locked_at" t.datetime "remember_created_at" - t.string "spree_api_key", :limit => 48 + t.string "spree_api_key", limit: 48 t.datetime "reset_password_sent_at" - t.string "api_key", :limit => 40 - t.integer "enterprise_limit", :default => 5, :null => false - t.string "locale", :limit => 5 + t.string "api_key", limit: 40 + t.integer "enterprise_limit", default: 5, null: false + t.string "locale", limit: 5 t.string "confirmation_token" t.datetime "confirmed_at" t.datetime "confirmation_sent_at" t.string "unconfirmed_email" end - add_index "spree_users", ["confirmation_token"], :name => "index_spree_users_on_confirmation_token", :unique => true - add_index "spree_users", ["email"], :name => "email_idx_unique", :unique => true - add_index "spree_users", ["persistence_token"], :name => "index_users_on_persistence_token" + 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 => true do |t| - t.string "sku", :default => "", :null => false - t.decimal "weight", :precision => 8, :scale => 2 - t.decimal "height", :precision => 8, :scale => 2 - t.decimal "width", :precision => 8, :scale => 2 - t.decimal "depth", :precision => 8, :scale => 2 + create_table "spree_variants", force: true do |t| + t.string "sku", default: "", null: false + t.decimal "weight", precision: 8, scale: 2 + 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.decimal "cost_price", :precision => 8, :scale => 2 + t.decimal "cost_price", precision: 8, scale: 2 t.integer "position" t.string "cost_currency" t.float "unit_value" - t.string "unit_description", :default => "" + t.string "unit_description", default: "" t.string "display_name" t.string "display_as" t.datetime "import_date" end - add_index "spree_variants", ["product_id"], :name => "index_variants_on_product_id" - add_index "spree_variants", ["sku"], :name => "index_spree_variants_on_sku" + 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 => true do |t| + create_table "spree_zone_members", force: true do |t| t.integer "zoneable_id" t.string "zoneable_type" t.integer "zone_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 end - create_table "spree_zones", :force => true do |t| + create_table "spree_zones", force: true do |t| t.string "name" t.string "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "default_tax", :default => false - t.integer "zone_members_count", :default => 0 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "default_tax", default: false + t.integer "zone_members_count", default: 0 end - create_table "stripe_accounts", :force => true do |t| + create_table "stripe_accounts", force: true do |t| t.string "stripe_user_id" t.string "stripe_publishable_key" - 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 "enterprise_id" end - add_index "stripe_accounts", ["enterprise_id"], :name => "index_stripe_accounts_on_enterprise_id", :unique => true + add_index "stripe_accounts", ["enterprise_id"], name: "index_stripe_accounts_on_enterprise_id", unique: true, using: :btree - create_table "subscription_line_items", :force => true do |t| - t.integer "subscription_id", :null => false - t.integer "variant_id", :null => false - t.integer "quantity", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.decimal "price_estimate", :precision => 8, :scale => 2 + create_table "subscription_line_items", force: true do |t| + t.integer "subscription_id", null: false + t.integer "variant_id", null: false + t.integer "quantity", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.decimal "price_estimate", precision: 8, scale: 2 end - add_index "subscription_line_items", ["subscription_id"], :name => "index_subscription_line_items_on_subscription_id" - add_index "subscription_line_items", ["variant_id"], :name => "index_subscription_line_items_on_variant_id" + 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 => true do |t| - t.integer "shop_id", :null => false - t.integer "customer_id", :null => false - t.integer "schedule_id", :null => false - t.integer "payment_method_id", :null => false - t.integer "shipping_method_id", :null => false + create_table "subscriptions", force: true do |t| + t.integer "shop_id", null: false + t.integer "customer_id", null: false + t.integer "schedule_id", null: false + t.integer "payment_method_id", null: false + t.integer "shipping_method_id", null: false t.datetime "begins_at" t.datetime "ends_at" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "bill_address_id", :null => false - t.integer "ship_address_id", :null => false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "bill_address_id", null: false + t.integer "ship_address_id", null: false t.datetime "canceled_at" t.datetime "paused_at" - t.decimal "shipping_fee_estimate", :precision => 8, :scale => 2 - t.decimal "payment_fee_estimate", :precision => 8, :scale => 2 + t.decimal "shipping_fee_estimate", precision: 8, scale: 2 + t.decimal "payment_fee_estimate", precision: 8, scale: 2 end - add_index "subscriptions", ["bill_address_id"], :name => "index_subscriptions_on_bill_address_id" - add_index "subscriptions", ["customer_id"], :name => "index_subscriptions_on_customer_id" - add_index "subscriptions", ["payment_method_id"], :name => "index_subscriptions_on_payment_method_id" - add_index "subscriptions", ["schedule_id"], :name => "index_subscriptions_on_schedule_id" - add_index "subscriptions", ["ship_address_id"], :name => "index_subscriptions_on_ship_address_id" - add_index "subscriptions", ["shipping_method_id"], :name => "index_subscriptions_on_shipping_method_id" - add_index "subscriptions", ["shop_id"], :name => "index_subscriptions_on_shop_id" + 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 => true do |t| + create_table "suburbs", force: true do |t| t.string "name" t.string "postcode" t.float "latitude" @@ -1151,39 +1156,39 @@ ActiveRecord::Schema.define(:version => 20191023172424) do t.integer "state_id" end - create_table "tag_rules", :force => true do |t| - t.integer "enterprise_id", :null => false - t.string "type", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "is_default", :default => false, :null => false - t.integer "priority", :default => 99, :null => false + create_table "tag_rules", force: true do |t| + t.integer "enterprise_id", null: false + t.string "type", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "is_default", default: false, null: false + t.integer "priority", default: 99, null: false end - create_table "taggings", :force => true do |t| + create_table "taggings", force: true do |t| t.integer "tag_id" t.integer "taggable_id" t.string "taggable_type" t.integer "tagger_id" t.string "tagger_type" - t.string "context", :limit => 128 + t.string "context", limit: 128 t.datetime "created_at" end - add_index "taggings", ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], :name => "taggings_idx", :unique => true - add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context" + 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 => true do |t| + create_table "tags", force: true do |t| t.string "name" - t.integer "taggings_count", :default => 0 + t.integer "taggings_count", default: 0 end - add_index "tags", ["name"], :name => "index_tags_on_name", :unique => true + add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree - create_table "variant_overrides", :force => true do |t| - t.integer "variant_id", :null => false - t.integer "hub_id", :null => false - t.decimal "price", :precision => 8, :scale => 2 + create_table "variant_overrides", force: true do |t| + t.integer "variant_id", null: false + t.integer "hub_id", null: false + t.decimal "price", precision: 8, scale: 2 t.integer "count_on_hand" t.integer "default_stock" t.boolean "resettable" @@ -1193,18 +1198,18 @@ ActiveRecord::Schema.define(:version => 20191023172424) do t.datetime "import_date" end - add_index "variant_overrides", ["variant_id", "hub_id"], :name => "index_variant_overrides_on_variant_id_and_hub_id" + add_index "variant_overrides", ["variant_id", "hub_id"], name: "index_variant_overrides_on_variant_id_and_hub_id", using: :btree - create_table "versions", :force => true do |t| - t.string "item_type", :null => false - t.integer "item_id", :null => false - t.string "event", :null => false + create_table "versions", force: true do |t| + t.string "item_type", null: false + t.integer "item_id", null: false + t.string "event", null: false t.string "whodunnit" t.text "object" t.datetime "created_at" end - add_index "versions", ["item_type", "item_id"], :name => "index_versions_on_item_type_and_item_id" + 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", name: "adjustment_metadata_adjustment_id_fk", column: "adjustment_id", dependent: :delete