# 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 that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20170605134146) do

  create_table "accepted_offers", force: :cascade do |t|
    t.datetime "created_at",                                                     null: false
    t.datetime "updated_at",                                                     null: false
    t.integer  "offer_id",    limit: 4
    t.integer  "customer_id", limit: 4
    t.string   "devis",       limit: 255
    t.string   "state",       limit: 255
    t.string   "string",      limit: 255
    t.decimal  "qte",                     precision: 10, scale: 2, default: 1.0
  end

  add_index "accepted_offers", ["customer_id"], name: "index_accepted_offers_on_customer_id", using: :btree
  add_index "accepted_offers", ["offer_id"], name: "index_accepted_offers_on_offer_id", using: :btree

  create_table "admins", force: :cascade do |t|
    t.string   "name",                   limit: 255
    t.string   "firstname",              limit: 255
    t.string   "avatar",                 limit: 255
    t.string   "username",               limit: 255, default: "", null: false
    t.string   "email",                  limit: 255, default: "", null: false
    t.string   "password_digest",        limit: 255, default: "", null: false
    t.string   "reset_password_token",   limit: 255
    t.datetime "reset_password_sent_at"
    t.datetime "remember_created_at"
    t.integer  "sign_in_count",          limit: 4,   default: 0
    t.datetime "current_sign_in_at"
    t.datetime "last_sign_in_at"
    t.string   "current_sign_in_ip",     limit: 255
    t.string   "last_sign_in_ip",        limit: 255
    t.string   "remember_token",         limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "albums", force: :cascade do |t|
    t.string   "name",        limit: 255
    t.boolean  "super_admin", limit: 1
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "archive_newsletters", force: :cascade do |t|
    t.integer  "newsletter_id", limit: 4
    t.string   "title",         limit: 255
    t.text     "content",       limit: 65535
    t.string   "email_from",    limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "archive_newsletters", ["newsletter_id"], name: "index_archive_newsletters_on_newsletter_id", using: :btree

  create_table "articles", force: :cascade do |t|
    t.datetime "published_at"
    t.string   "title",           limit: 255
    t.string   "slug",            limit: 255
    t.string   "tag",             limit: 255
    t.text     "description",     limit: 65535
    t.text     "keywords",        limit: 65535
    t.boolean  "enabled",         limit: 1
    t.integer  "image_file_id",   limit: 4
    t.boolean  "title_cached",    limit: 1
    t.string   "tags_cache",      limit: 255
    t.string   "tags_cache_slug", limit: 255
    t.integer  "category_id",     limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "block_contents", force: :cascade do |t|
    t.integer  "style",       limit: 4
    t.integer  "nbr_columns", limit: 4
    t.integer  "row1",        limit: 4
    t.integer  "row2",        limit: 4
    t.integer  "row3",        limit: 4
    t.integer  "row4",        limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "blocks", force: :cascade do |t|
    t.string   "block_name",     limit: 255
    t.string   "blockable_type", limit: 255
    t.integer  "blockable_id",   limit: 4
    t.text     "content",        limit: 65535
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "break_contents", force: :cascade do |t|
    t.boolean  "line",       limit: 1
    t.integer  "height",     limit: 4
    t.string   "style",      limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "categories", force: :cascade do |t|
    t.string   "name",          limit: 255
    t.string   "slug",          limit: 255
    t.boolean  "enabled",       limit: 1
    t.text     "description",   limit: 65535
    t.integer  "image_file_id", limit: 4
    t.integer  "position",      limit: 4
    t.integer  "parent_id",     limit: 4
    t.string   "permalink",     limit: 255
    t.boolean  "front_page",    limit: 1
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "cel_tables", force: :cascade do |t|
    t.integer  "position",         limit: 4
    t.integer  "style",            limit: 4
    t.integer  "table_row_id",     limit: 4
    t.integer  "table_content_id", limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "comments", force: :cascade do |t|
    t.string   "pseudo",           limit: 255,   default: ""
    t.string   "email",            limit: 255,   default: ""
    t.string   "website",          limit: 255,   default: ""
    t.boolean  "enabled",          limit: 1
    t.text     "comment",          limit: 65535
    t.integer  "commentable_id",   limit: 4
    t.string   "commentable_type", limit: 255
    t.integer  "user_id",          limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "contact_messages", force: :cascade do |t|
    t.integer  "customer_id",      limit: 4
    t.integer  "admin_id",         limit: 4
    t.integer  "contact_id",       limit: 4
    t.datetime "deleted_at"
    t.boolean  "read_by_admin",    limit: 1,     default: false
    t.boolean  "read_by_customer", limit: 1,     default: false
    t.text     "content",          limit: 65535
    t.datetime "created_at",                                     null: false
    t.datetime "updated_at",                                     null: false
  end

  create_table "conversations", force: :cascade do |t|
    t.boolean  "oneone",             limit: 1
    t.integer  "first_customer_id",  limit: 4
    t.string   "second_customer_id", limit: 255
    t.datetime "created_at",                     null: false
    t.datetime "updated_at",                     null: false
  end

  create_table "customer_messages", force: :cascade do |t|
    t.string   "title",             limit: 255
    t.text     "message",           limit: 65535
    t.string   "tel",               limit: 255
    t.integer  "expediteur_id",     limit: 4
    t.string   "expediteur_mail",   limit: 255
    t.string   "destinataire_mail", limit: 255
    t.integer  "destinataire_id",   limit: 4
    t.integer  "parent_id",         limit: 4
    t.datetime "last_message_at"
    t.string   "remote_ip",         limit: 255
    t.boolean  "enabled",           limit: 1
    t.boolean  "readed",            limit: 1
    t.datetime "created_at",                      null: false
    t.datetime "updated_at",                      null: false
    t.integer  "conversation_id",   limit: 4
  end

  add_index "customer_messages", ["conversation_id"], name: "index_customer_messages_on_conversation_id", using: :btree

  create_table "customer_newsgroups", force: :cascade do |t|
    t.integer  "customer_id",  limit: 4
    t.integer  "newsgroup_id", limit: 4
    t.datetime "created_at",             null: false
    t.datetime "updated_at",             null: false
  end

  add_index "customer_newsgroups", ["customer_id"], name: "index_customer_newsgroups_on_customer_id", using: :btree
  add_index "customer_newsgroups", ["newsgroup_id"], name: "index_customer_newsgroups_on_newsgroup_id", using: :btree

  create_table "customers", force: :cascade do |t|
    t.integer  "parent_id",              limit: 4
    t.string   "parent_code",            limit: 255
    t.string   "parent_at_create",       limit: 255
    t.boolean  "archived",               limit: 1
    t.boolean  "enabled",                limit: 1
    t.string   "username",               limit: 255
    t.string   "name",                   limit: 255
    t.string   "firstname",              limit: 255
    t.string   "organisation",           limit: 255
    t.string   "siret",                  limit: 255
    t.string   "tva_number",             limit: 255
    t.text     "bio",                    limit: 65535
    t.string   "avatar",                 limit: 255
    t.string   "localisation",           limit: 255
    t.boolean  "pro",                    limit: 1,     default: false
    t.string   "token",                  limit: 255
    t.string   "mlm_token",              limit: 255
    t.string   "address",                limit: 255
    t.string   "address2",               limit: 255
    t.string   "cp",                     limit: 255
    t.string   "city",                   limit: 255
    t.string   "country",                limit: 255
    t.string   "phone",                  limit: 255
    t.text     "attentes",               limit: 65535
    t.text     "suggests",               limit: 65535
    t.text     "need_1",                 limit: 65535
    t.text     "need_2",                 limit: 65535
    t.text     "need_3",                 limit: 65535
    t.integer  "conseil_techniques",     limit: 4
    t.integer  "conseil_juridiques",     limit: 4
    t.integer  "conseil_gestion",        limit: 4
    t.integer  "courtage_gros",          limit: 4
    t.integer  "courtage_energie",       limit: 4
    t.integer  "courtage_info",          limit: 4
    t.integer  "courtage_pret",          limit: 4
    t.integer  "courtage_presta",        limit: 4
    t.integer  "courtage_autres",        limit: 4
    t.string   "email",                  limit: 255,   default: "",    null: false
    t.string   "password_digest",        limit: 255,   default: "",    null: false
    t.string   "reset_password_token",   limit: 255
    t.datetime "reset_password_sent_at"
    t.datetime "remember_created_at"
    t.integer  "sign_in_count",          limit: 4,     default: 0
    t.datetime "current_sign_in_at"
    t.datetime "last_sign_in_at"
    t.string   "current_sign_in_ip",     limit: 255
    t.string   "last_sign_in_ip",        limit: 255
    t.boolean  "lock",                   limit: 1
    t.datetime "locked_at"
    t.datetime "created_at",                                           null: false
    t.datetime "updated_at",                                           null: false
    t.boolean  "account_validated",      limit: 1
    t.datetime "account_validated_at"
    t.float    "latitude",               limit: 24
    t.float    "longitude",              limit: 24
    t.datetime "last_activity"
    t.text     "particulars_text",       limit: 65535
    t.float    "capital",                limit: 24
    t.string   "role_signataire",        limit: 255
    t.boolean  "referent",               limit: 1,     default: false
    t.boolean  "chef_reseau",            limit: 1,     default: false
    t.string   "reseaux_token",          limit: 255
  end

  create_table "data_files", force: :cascade do |t|
    t.string   "file",           limit: 255
    t.string   "name",           limit: 255
    t.string   "slug",           limit: 255
    t.string   "token",          limit: 255
    t.string   "description",    limit: 255
    t.integer  "file_folder_id", limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "documents", force: :cascade do |t|
    t.integer  "accepted_offer_id", limit: 4
    t.datetime "deleted_at"
    t.string   "title",             limit: 255
    t.string   "state",             limit: 255
    t.string   "document",          limit: 255
    t.string   "returned_document", limit: 255
    t.datetime "created_at",                    null: false
    t.datetime "updated_at",                    null: false
    t.boolean  "particulars",       limit: 1
    t.string   "download_token",    limit: 255
  end

  create_table "domain_customers", force: :cascade do |t|
    t.integer  "domain_id",   limit: 4
    t.integer  "customer_id", limit: 4
    t.datetime "created_at",            null: false
    t.datetime "updated_at",            null: false
  end

  add_index "domain_customers", ["customer_id"], name: "index_domain_customers_on_customer_id", using: :btree
  add_index "domain_customers", ["domain_id"], name: "index_domain_customers_on_domain_id", using: :btree

  create_table "domain_need_categories", force: :cascade do |t|
    t.integer  "domain_id",        limit: 4
    t.integer  "need_category_id", limit: 4
    t.datetime "created_at",                 null: false
    t.datetime "updated_at",                 null: false
  end

  add_index "domain_need_categories", ["domain_id"], name: "index_domain_need_categories_on_domain_id", using: :btree
  add_index "domain_need_categories", ["need_category_id"], name: "index_domain_need_categories_on_need_category_id", using: :btree

  create_table "domain_needs", force: :cascade do |t|
    t.integer  "domain_id",  limit: 4
    t.integer  "need_id",    limit: 4
    t.datetime "created_at",           null: false
    t.datetime "updated_at",           null: false
  end

  add_index "domain_needs", ["domain_id"], name: "index_domain_needs_on_domain_id", using: :btree
  add_index "domain_needs", ["need_id"], name: "index_domain_needs_on_need_id", using: :btree

  create_table "domains", force: :cascade do |t|
    t.string   "name",        limit: 255
    t.string   "slug",        limit: 255
    t.boolean  "superadmin",  limit: 1
    t.boolean  "enabled",     limit: 1
    t.text     "description", limit: 65535
    t.datetime "created_at",                null: false
    t.datetime "updated_at",                null: false
  end

  create_table "download_contents", force: :cascade do |t|
    t.string   "title",        limit: 255
    t.string   "style",        limit: 255
    t.text     "description",  limit: 65535
    t.integer  "data_file_id", limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "dynamic_contents", force: :cascade do |t|
    t.string   "name",       limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "external_links", force: :cascade do |t|
    t.string   "title",       limit: 255
    t.text     "description", limit: 65535
    t.string   "url",         limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "file_folders", force: :cascade do |t|
    t.string   "name",        limit: 255
    t.boolean  "super_admin", limit: 1
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "gallery_contents", force: :cascade do |t|
    t.string   "name",        limit: 255
    t.text     "description", limit: 65535
    t.integer  "style",       limit: 4
    t.integer  "nbr_img",     limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "gallery_images", force: :cascade do |t|
    t.string   "title",              limit: 255
    t.text     "description",        limit: 65535
    t.string   "tags",               limit: 255
    t.integer  "position",           limit: 4
    t.integer  "image_file_id",      limit: 4
    t.integer  "gallery_content_id", limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "html_contents", force: :cascade do |t|
    t.text     "content",      limit: 65535
    t.string   "style",        limit: 255
    t.string   "content_type", limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "image_contents", force: :cascade do |t|
    t.integer  "image_file_id", limit: 4
    t.integer  "width",         limit: 4
    t.integer  "height",        limit: 4
    t.string   "alignement",    limit: 255
    t.boolean  "expandable",    limit: 1
    t.string   "style",         limit: 255
    t.string   "alt",           limit: 255
    t.integer  "cible_id",      limit: 4
    t.string   "cible_type",    limit: 255
    t.boolean  "with_cible",    limit: 1
    t.boolean  "popup",         limit: 1
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "image_files", force: :cascade do |t|
    t.string   "file",        limit: 255
    t.string   "name",        limit: 255
    t.string   "slug",        limit: 255
    t.text     "description", limit: 65535
    t.string   "tags",        limit: 255
    t.integer  "album_id",    limit: 4
    t.string   "photograph",  limit: 255
    t.string   "cible_type",  limit: 255
    t.integer  "cible_id",    limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "link_contents", force: :cascade do |t|
    t.integer  "type",       limit: 4
    t.string   "name",       limit: 255
    t.string   "title",      limit: 255
    t.boolean  "popup",      limit: 1
    t.string   "url",        limit: 255
    t.string   "style",      limit: 255
    t.integer  "cible_id",   limit: 4
    t.string   "cible_type", limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "mail_archives", force: :cascade do |t|
    t.integer  "newsletter_id",         limit: 4
    t.integer  "archive_newsletter_id", limit: 4
    t.string   "email",                 limit: 255
    t.integer  "customer_id",           limit: 4
    t.string   "token",                 limit: 255
    t.boolean  "readed",                limit: 1
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "mail_archives", ["archive_newsletter_id"], name: "index_mail_archives_on_archive_newsletter_id", using: :btree
  add_index "mail_archives", ["customer_id"], name: "index_mail_archives_on_customer_id", using: :btree
  add_index "mail_archives", ["newsletter_id"], name: "index_mail_archives_on_newsletter_id", using: :btree

  create_table "map_contents", force: :cascade do |t|
    t.string   "address",    limit: 255
    t.string   "name",       limit: 255
    t.integer  "view",       limit: 4
    t.boolean  "info_bule",  limit: 1
    t.integer  "zoom",       limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "menu_aliases", force: :cascade do |t|
    t.integer  "menu_item_id", limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "menu_items", force: :cascade do |t|
    t.string   "name",              limit: 255
    t.string   "slug",              limit: 255
    t.string   "permalink",         limit: 255
    t.string   "section_name",      limit: 255
    t.integer  "section_id",        limit: 4
    t.string   "repertoire_name",   limit: 255
    t.integer  "repertoire_id",     limit: 4
    t.integer  "parent_id",         limit: 4
    t.integer  "position",          limit: 4
    t.boolean  "super_admin",       limit: 1
    t.boolean  "enabled",           limit: 1
    t.boolean  "visible",           limit: 1
    t.boolean  "deleted",           limit: 1
    t.integer  "menu_id",           limit: 4
    t.integer  "menu_content_id",   limit: 4
    t.string   "menu_content_type", limit: 255
    t.integer  "archive_id",        limit: 4
    t.boolean  "archived",          limit: 1
    t.datetime "archived_at"
    t.boolean  "password",          limit: 1
    t.boolean  "comment",           limit: 1
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "menu_urls", force: :cascade do |t|
    t.string   "url",        limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "menus", force: :cascade do |t|
    t.string   "name",       limit: 255
    t.string   "max_levels", limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "messages", force: :cascade do |t|
    t.datetime "created_at",                null: false
    t.datetime "updated_at",                null: false
    t.integer  "customer_id", limit: 4
    t.integer  "need_id",     limit: 4
    t.text     "content",     limit: 65535
    t.integer  "admin_id",    limit: 4
  end

  add_index "messages", ["admin_id"], name: "index_messages_on_admin_id", using: :btree

  create_table "need_categories", force: :cascade do |t|
    t.datetime "created_at",                     null: false
    t.datetime "updated_at",                     null: false
    t.string   "name",               limit: 255
    t.integer  "need_categories_id", limit: 4
    t.integer  "parent_id",          limit: 4
  end

  add_index "need_categories", ["need_categories_id"], name: "index_need_categories_on_need_categories_id", using: :btree
  add_index "need_categories", ["parent_id"], name: "index_need_categories_on_parent_id", using: :btree

  create_table "needs", force: :cascade do |t|
    t.string   "title",                 limit: 255
    t.text     "description",           limit: 65535
    t.datetime "created_at",                          null: false
    t.datetime "updated_at",                          null: false
    t.integer  "author_id",             limit: 4
    t.datetime "deleted_at"
    t.string   "state",                 limit: 255
    t.integer  "category_id",           limit: 4
    t.string   "devis",                 limit: 255
    t.integer  "image_file_id",         limit: 4
    t.text     "note",                  limit: 65535
    t.integer  "referent_negos_id",     limit: 4
    t.integer  "referent_technique_id", limit: 4
  end

  add_index "needs", ["author_id"], name: "index_needs_on_author_id", using: :btree
  add_index "needs", ["category_id"], name: "index_needs_on_category_id", using: :btree
  add_index "needs", ["deleted_at"], name: "index_needs_on_deleted_at", using: :btree
  add_index "needs", ["image_file_id"], name: "index_needs_on_image_file_id", using: :btree
  add_index "needs", ["title"], name: "index_needs_on_title", using: :btree

  create_table "newsgroups", force: :cascade do |t|
    t.string   "name",            limit: 255
    t.string   "slug",            limit: 255
    t.boolean  "default_checked", limit: 1
    t.boolean  "enabled",         limit: 1
    t.datetime "created_at",                  null: false
    t.datetime "updated_at",                  null: false
  end

  create_table "newsletters", force: :cascade do |t|
    t.string   "title",      limit: 255
    t.text     "content",    limit: 65535
    t.datetime "sendmail"
    t.boolean  "archive",    limit: 1
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "offer_reseauxes", force: :cascade do |t|
    t.integer  "offer_id",   limit: 4
    t.integer  "reseaux_id", limit: 4
    t.datetime "created_at",           null: false
    t.datetime "updated_at",           null: false
  end

  add_index "offer_reseauxes", ["offer_id"], name: "index_offer_reseauxes_on_offer_id", using: :btree
  add_index "offer_reseauxes", ["reseaux_id"], name: "index_offer_reseauxes_on_reseaux_id", using: :btree

  create_table "offers", force: :cascade do |t|
    t.datetime "created_at",                                                        null: false
    t.datetime "updated_at",                                                        null: false
    t.float    "price",          limit: 24
    t.float    "fee_percentage", limit: 24
    t.integer  "need_id",        limit: 4
    t.string   "supplier",       limit: 255
    t.datetime "deleted_at"
    t.decimal  "qte",                        precision: 10, scale: 2, default: 1.0
    t.decimal  "gain",                       precision: 10, scale: 2
  end

  add_index "offers", ["deleted_at"], name: "index_offers_on_deleted_at", using: :btree
  add_index "offers", ["need_id"], name: "index_offers_on_need_id", using: :btree

  create_table "pages", force: :cascade do |t|
    t.text     "title",       limit: 65535
    t.text     "description", limit: 65535
    t.text     "keywords",    limit: 65535
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "portlets", force: :cascade do |t|
    t.integer  "block_id",     limit: 4
    t.integer  "content_id",   limit: 4
    t.string   "content_type", limit: 255
    t.integer  "position",     limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "reseaux_customers", force: :cascade do |t|
    t.integer  "reseaux_id",  limit: 4
    t.integer  "customer_id", limit: 4
    t.datetime "created_at",            null: false
    t.datetime "updated_at",            null: false
  end

  add_index "reseaux_customers", ["customer_id"], name: "index_reseaux_customers_on_customer_id", using: :btree
  add_index "reseaux_customers", ["reseaux_id"], name: "index_reseaux_customers_on_reseaux_id", using: :btree

  create_table "reseauxes", force: :cascade do |t|
    t.string   "name",           limit: 255
    t.text     "description",    limit: 65535
    t.integer  "chef_reseau_id", limit: 4
    t.datetime "created_at",                   null: false
    t.datetime "updated_at",                   null: false
    t.string   "token",          limit: 255
    t.integer  "parent_id",      limit: 4
  end

  create_table "sessions", force: :cascade do |t|
    t.string   "session_id", limit: 255,   null: false
    t.text     "data",       limit: 65535
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "sessions", ["updated_at"], name: "index_sessions_on_updated_at", using: :btree

  create_table "table_contents", force: :cascade do |t|
    t.integer  "style",      limit: 4
    t.integer  "nbr_rows",   limit: 4
    t.integer  "nbr_cols",   limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "table_rows", force: :cascade do |t|
    t.integer  "position",         limit: 4
    t.integer  "style",            limit: 4
    t.integer  "table_content_id", limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "tag_taggables", force: :cascade do |t|
    t.string   "taggable_type", limit: 255
    t.integer  "taggable_id",   limit: 4
    t.integer  "tag_id",        limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "tags", force: :cascade do |t|
    t.string   "name",          limit: 255
    t.string   "slug",          limit: 255
    t.integer  "parent_id",     limit: 4
    t.boolean  "public",        limit: 1
    t.string   "taggable_type", limit: 255
    t.integer  "taggable_id",   limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "text_contents", force: :cascade do |t|
    t.string   "style",      limit: 255
    t.text     "content",    limit: 65535
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "thing_conversations", force: :cascade do |t|
    t.integer  "thing_id",        limit: 4
    t.string   "thing_type",      limit: 255
    t.integer  "conversation_id", limit: 4
    t.datetime "created_at",                  null: false
    t.datetime "updated_at",                  null: false
  end

  add_index "thing_conversations", ["conversation_id"], name: "index_thing_conversations_on_conversation_id", using: :btree

  create_table "title_contents", force: :cascade do |t|
    t.text     "content",    limit: 65535
    t.integer  "level",      limit: 4
    t.string   "style",      limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "wishes", force: :cascade do |t|
    t.integer  "customer_id", limit: 4
    t.integer  "need_id",     limit: 4
    t.datetime "created_at",                                                       null: false
    t.datetime "updated_at",                                                       null: false
    t.text     "note",        limit: 65535
    t.string   "devis",       limit: 255
    t.decimal  "qte",                       precision: 10, scale: 2, default: 1.0
  end

  add_foreign_key "customer_messages", "conversations"
  add_foreign_key "customer_newsgroups", "customers"
  add_foreign_key "customer_newsgroups", "newsgroups"
  add_foreign_key "domain_customers", "customers"
  add_foreign_key "domain_customers", "domains"
  add_foreign_key "domain_need_categories", "domains"
  add_foreign_key "domain_need_categories", "need_categories"
  add_foreign_key "domain_needs", "domains"
  add_foreign_key "domain_needs", "needs"
  add_foreign_key "offer_reseauxes", "offers"
  add_foreign_key "offer_reseauxes", "reseauxes"
  add_foreign_key "reseaux_customers", "customers"
  add_foreign_key "reseaux_customers", "reseauxes"
  add_foreign_key "thing_conversations", "conversations"
end
