# 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. # # Note that this schema.rb definition is the authoritative source for your # database schema. If you need to create the application database on another # system, you should be using db:schema:load, not running all the migrations # 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 that you check this file into your version control system. ActiveRecord::Schema.define(version: 20180605061228) do create_table "admins", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_polish_ci" do |t| t.string "email", default: "", null: false t.string "description", limit: 80 t.string "encrypted_password", default: "", null: false t.string "reset_password_token" t.datetime "reset_password_sent_at" t.datetime "remember_created_at" t.integer "sign_in_count", default: 0, null: false t.datetime "current_sign_in_at" t.datetime "last_sign_in_at" t.string "current_sign_in_ip" t.string "last_sign_in_ip" t.integer "failed_attempts", default: 0, null: false t.string "unlock_token" t.datetime "locked_at" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["email"], name: "index_admins_on_email", unique: true t.index ["reset_password_token"], name: "index_admins_on_reset_password_token", unique: true t.index ["unlock_token"], name: "index_admins_on_unlock_token", unique: true end create_table "all_pages", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_polish_ci" do |t| t.string "name", limit: 40, null: false t.string "title", null: false t.string "slug", null: false t.string "meta_description" t.boolean "nofollow", default: false t.integer "type_of", null: false t.integer "article_id" t.text "small_text" t.text "full_text", limit: 16777215 t.timestamp "updated_at" t.bigint "updated_by" t.boolean "published", default: false, null: false end create_table "articles", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_polish_ci" do |t| t.string "name", null: false t.timestamp "updated_at" t.bigint "updated_by" end create_table "cart_products", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| t.bigint "cart_id", null: false t.integer "product_id", null: false t.integer "quantity", null: false t.decimal "price", precision: 10, scale: 2, null: false t.datetime "created_at" t.datetime "updated_at" t.index ["cart_id", "product_id"], name: "cart_id" end create_table "carts", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| t.string "uuid", limit: 80, null: false t.string "ip" t.string "useragent" t.datetime "created_at" t.datetime "updated_at" t.index ["uuid"], name: "uuid" end create_table "categories", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| t.integer "parent_id", default: 0, null: false t.integer "level_depth", default: 0, null: false t.string "name", null: false t.string "slug", null: false t.boolean "active", default: true, null: false t.datetime "created_at" t.bigint "created_by" t.datetime "updated_at" t.bigint "updated_by" t.index ["active"], name: "active" t.index ["name"], name: "name" t.index ["parent_id"], name: "parent_id" t.index ["slug"], name: "slug" end create_table "categories_products", id: false, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| t.integer "category_id", null: false t.integer "product_id", null: false t.integer "position", default: 0, null: false t.index ["category_id", "product_id"], name: "unique_index", unique: true end create_table "friendly_id_slugs", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_polish_ci" do |t| t.string "slug", null: false t.integer "sluggable_id", null: false t.string "sluggable_type", limit: 50 t.string "scope" t.datetime "created_at" t.index ["slug", "sluggable_type", "scope"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope", unique: true t.index ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type" t.index ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id" t.index ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type" end create_table "images", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| t.string "imageable_type", null: false t.bigint "imageable_id", null: false t.string "image_file_name", null: false t.string "image_content_type", null: false t.integer "image_file_size", null: false t.datetime "updated_at" t.integer "updated_by" t.integer "position", default: 0, null: false t.boolean "cover", default: false, null: false t.boolean "active", default: true, null: false t.index ["active"], name: "active" t.index ["cover"], name: "cover" t.index ["imageable_type", "imageable_id"], name: "pictures" t.index ["position"], name: "position" end create_table "order_faqs", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| t.string "title", limit: 40, null: false t.text "description", null: false t.integer "position", default: 0, null: false t.integer "active", default: 0, null: false t.datetime "created_at" t.bigint "created_by" t.datetime "updated_at" t.bigint "updated_by" t.index ["position"], name: "position" end create_table "order_histories", id: :bigint, unsigned: true, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| t.bigint "order_id", null: false t.integer "status", null: false t.datetime "created_at" t.integer "created_by" t.index ["order_id"], name: "order_id" end create_table "order_products", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| t.integer "order_id", null: false t.integer "product_id", null: false t.integer "quantity", null: false t.decimal "price", precision: 10, scale: 2, null: false t.datetime "created_at" t.datetime "updated_at" t.index ["order_id", "product_id"], name: "order_id" end create_table "orders", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| t.integer "order_number" t.bigint "cart_id", null: false t.integer "shipping_id" t.integer "payment_method_id" t.boolean "terms_of_service_acceptance" t.string "email" t.string "first_name", limit: 80 t.string "last_name", limit: 80 t.string "phone", limit: 15 t.string "street" t.string "city", limit: 80 t.string "zip_code", limit: 10 t.string "voivodeship" t.string "country" t.text "message_from_client" t.integer "status", default: 0, null: false t.datetime "created_at" t.datetime "updated_at" t.bigint "updated_by" end create_table "payment_methods", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| t.string "name", limit: 40, null: false t.string "description", null: false t.boolean "default", default: false, null: false t.boolean "active", default: false, null: false t.datetime "created_at" t.integer "created_by" t.datetime "updated_at" t.integer "updated_by" end create_table "products", id: :integer, unsigned: true, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| t.string "name", null: false t.string "slug", null: false t.text "description" t.text "description_short" t.integer "default_category_id", null: false t.decimal "price", precision: 10, scale: 2, null: false t.integer "quantity", default: 0, null: false t.boolean "chk_quantity", default: false, null: false t.boolean "active", default: false, null: false t.datetime "created_at" t.bigint "created_by", unsigned: true t.datetime "updated_at" t.bigint "updated_by", unsigned: true t.index ["active"], name: "active" t.index ["name"], name: "name" t.index ["slug"], name: "slug" end create_table "published_pages", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_polish_ci" do |t| t.string "name", limit: 40, null: false t.string "title", null: false t.string "slug", null: false t.string "meta_description" t.integer "all_page_id", null: false t.boolean "nofollow", default: false, null: false t.integer "number_of_views", default: 0, null: false t.integer "type_of", null: false t.integer "article_id" t.integer "priority", default: 0, null: false t.text "small_text" t.text "full_text", limit: 16777215 t.timestamp "created_at" t.bigint "created_by" t.timestamp "updated_at" t.bigint "updated_by" t.index ["all_page_id"], name: "all_page_id" t.index ["created_at"], name: "created_at" t.index ["number_of_views"], name: "number_of_views" t.index ["slug"], name: "slug" t.index ["type_of"], name: "type_of" end create_table "sc_settings", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_polish_ci" do |t| t.integer "index_number_of_views", default: 0, null: false t.integer "contact_number_of_views", default: 0, null: false t.string "shop_name" t.boolean "chk_quantity_global", default: false, null: false t.boolean "shop_active", default: true, null: false t.text "index_page_first_info", limit: 4294967295 t.text "index_page_second_info", limit: 4294967295 t.text "index_page_content", limit: 4294967295 t.text "shop_owners_emails" t.boolean "recaptcha_chk", default: false, null: false t.datetime "updated_at" t.integer "updated_by" end create_table "shippings", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| t.string "name", null: false t.decimal "price", precision: 10, scale: 2, null: false t.boolean "default", default: false, null: false t.boolean "active", default: true, null: false t.datetime "created_at" t.bigint "created_by" t.datetime "updated_at" t.bigint "updated_by" t.index ["active"], name: "active" t.index ["default"], name: "default" t.index ["name"], name: "name" end end