Skip to content

Instantly share code, notes, and snippets.

@kenjione
Created December 18, 2012 12:45
Show Gist options
  • Save kenjione/4327661 to your computer and use it in GitHub Desktop.
Save kenjione/4327661 to your computer and use it in GitHub Desktop.
schema
# 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.
#
# 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 to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20121217110829) do
create_table "addresses", :force => true do |t|
t.integer "zipcode"
t.integer "city_id"
t.string "street_line"
end
create_table "authentications", :force => true do |t|
t.string "uid"
t.string "provider"
t.text "info"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "badges", :force => true do |t|
t.string "name"
t.string "color"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.boolean "static", :default => false
end
create_table "badges_variants", :id => false, :force => true do |t|
t.integer "badge_id", :null => false
t.integer "variant_id", :null => false
end
create_table "banners", :force => true do |t|
t.string "name"
t.string "target"
t.string "url"
t.integer "user_id"
t.boolean "published"
t.date "start_at"
t.date "end_at"
t.integer "height"
t.integer "width"
t.string "image"
t.text "text"
t.string "path"
t.string "place"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "brands", :force => true do |t|
t.string "name"
t.text "description"
t.string "logo"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "cities", :force => true do |t|
t.string "name"
end
create_table "colors", :force => true do |t|
t.string "name"
t.string "rgb"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "delivery_informations", :force => true do |t|
t.integer "user_id"
t.integer "address_id"
t.string "name"
t.string "phone_number"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "friendly_id_slugs", :force => true do |t|
t.string "slug", :null => false
t.integer "sluggable_id", :null => false
t.string "sluggable_type", :limit => 40
t.datetime "created_at"
end
add_index "friendly_id_slugs", ["slug", "sluggable_type"], :name => "index_friendly_id_slugs_on_slug_and_sluggable_type", :unique => true
add_index "friendly_id_slugs", ["sluggable_id"], :name => "index_friendly_id_slugs_on_sluggable_id"
add_index "friendly_id_slugs", ["sluggable_type"], :name => "index_friendly_id_slugs_on_sluggable_type"
create_table "invoices", :force => true do |t|
t.integer "user_id"
t.integer "delivery_information_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.text "comment"
t.string "state"
t.string "payment_method"
t.integer "payment_information_id"
t.integer "amount_cents"
end
create_table "items", :force => true do |t|
t.integer "order_id"
t.integer "variant_id"
t.integer "quantity"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
add_index "items", ["order_id"], :name => "index_items_on_order_id"
create_table "materials", :force => true do |t|
t.string "name"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "moderations", :force => true do |t|
t.integer "moderatable_id"
t.string "moderatable_type"
t.text "data", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "owner_id"
t.integer "parent_id"
t.string "parent_type"
end
create_table "orders", :force => true do |t|
t.integer "user_id"
t.integer "shop_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "state"
t.integer "invoice_id"
end
add_index "orders", ["state"], :name => "index_orders_on_state"
create_table "page_images", :force => true do |t|
t.integer "user_id"
t.string "image"
t.string "name"
t.string "type"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "page_rubrics", :force => true do |t|
t.string "name"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "pages", :force => true do |t|
t.string "title"
t.text "markdown"
t.text "html"
t.string "slug"
t.string "latin_name"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "page_rubric_id"
t.boolean "delta", :default => true, :null => false
end
add_index "pages", ["delta"], :name => "index_pages_on_delta"
create_table "payment_informations", :force => true do |t|
t.string "name"
t.integer "address_id"
t.string "inn"
t.string "kpp"
t.string "bik"
t.string "bank_name"
t.string "correspondent_account"
t.string "current_account"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "permissions", :force => true do |t|
t.string "name"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "permissions_roles", :id => false, :force => true do |t|
t.integer "role_id", :null => false
t.integer "permission_id", :null => false
end
add_index "permissions_roles", ["role_id", "permission_id"], :name => "permissions_roles_idx"
create_table "posts", :force => true do |t|
t.string "name"
t.string "type"
t.integer "author_id"
t.text "markdown"
t.text "html"
t.string "image"
t.datetime "published_at"
t.boolean "published"
t.datetime "on_main_page_since"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.text "annotation"
t.boolean "delta", :default => true, :null => false
end
add_index "posts", ["delta"], :name => "index_posts_on_delta"
create_table "products", :force => true do |t|
t.string "name"
t.text "description"
t.integer "rubric_id"
t.integer "brand_id"
t.integer "style_id"
t.text "admin_comment"
t.text "agent_comment"
t.integer "shop_id"
t.string "state"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "country_code"
t.boolean "delta", :default => true, :null => false
t.string "country_cache"
end
add_index "products", ["delta"], :name => "index_products_on_delta"
create_table "roles", :force => true do |t|
t.string "name"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.boolean "requestable", :default => false
end
create_table "roles_users", :id => false, :force => true do |t|
t.integer "role_id", :null => false
t.integer "user_id", :null => false
end
add_index "roles_users", ["role_id", "user_id"], :name => "roles_users_idx"
create_table "rubrics", :force => true do |t|
t.string "name"
t.boolean "visibility", :default => true
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "ancestry"
t.integer "position"
t.integer "ancestry_depth"
t.boolean "delta", :default => true, :null => false
end
add_index "rubrics", ["ancestry"], :name => "index_rubrics_on_ancestry"
add_index "rubrics", ["delta"], :name => "index_rubrics_on_delta"
create_table "shops", :force => true do |t|
t.string "name"
t.integer "owner_id"
t.string "head_of_organization"
t.string "post_of_head"
t.string "chief_accountant"
t.string "taxpayer_number"
t.string "primary_registration_number"
t.string "reason_code_statement_on_the_account"
t.string "bank_identification_code"
t.string "bank_name"
t.string "correspondent_account"
t.string "payment_account"
t.string "licenses"
t.string "permissions"
t.string "phone"
t.string "site"
t.boolean "has_yml_catalogue", :default => false
t.integer "actual_address_id"
t.boolean "legal_address_as_actual", :default => true
t.integer "legal_address_id"
t.boolean "postal_address_as_actual", :default => true
t.integer "postal_address_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "styles", :force => true do |t|
t.string "name"
t.string "logo"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.boolean "delta", :default => true, :null => false
end
add_index "styles", ["delta"], :name => "index_styles_on_delta"
create_table "users", :force => true do |t|
t.string "email", :default => "", :null => false
t.string "encrypted_password", :default => ""
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", :default => 0
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.string "confirmation_token"
t.datetime "confirmed_at"
t.datetime "confirmation_sent_at"
t.string "unconfirmed_email"
t.string "authentication_token"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "invitation_token", :limit => 60
t.datetime "invitation_sent_at"
t.datetime "invitation_accepted_at"
t.integer "invitation_limit"
t.integer "invited_by_id"
t.string "invited_by_type"
t.string "phone"
t.integer "requested_role_id"
t.string "avatar"
t.string "name"
t.string "sex"
t.integer "favorite_style_id"
end
add_index "users", ["authentication_token"], :name => "index_users_on_authentication_token", :unique => true
add_index "users", ["confirmation_token"], :name => "index_users_on_confirmation_token", :unique => true
add_index "users", ["email"], :name => "index_users_on_email", :unique => true
add_index "users", ["invitation_token"], :name => "index_users_on_invitation_token"
add_index "users", ["invited_by_id"], :name => "index_users_on_invited_by_id"
add_index "users", ["requested_role_id"], :name => "index_users_on_requested_role_id"
add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
create_table "users_variants", :id => false, :force => true do |t|
t.integer "user_id"
t.integer "variant_id"
end
add_index "users_variants", ["user_id", "variant_id"], :name => "index_users_variants_on_user_id_and_variant_id", :unique => true
create_table "variant_images", :force => true do |t|
t.string "image"
t.integer "position"
t.integer "variant_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "variants", :force => true do |t|
t.string "sku"
t.string "name"
t.integer "material_id"
t.integer "product_id"
t.integer "color_id"
t.float "height"
t.float "width"
t.float "length"
t.integer "old_agent_price_cents"
t.integer "agent_price_cents"
t.integer "recommended_price_cents"
t.integer "old_price_cents"
t.integer "price_cents"
t.date "delivery_date"
t.integer "quantity_in_stock", :default => 0
t.integer "position"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.boolean "published", :default => false
t.float "diameter"
t.integer "variant_image_id"
t.boolean "delta", :default => true, :null => false
end
add_index "variants", ["delta"], :name => "index_variants_on_delta"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment