# 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: 20240424110455) do

  create_table "ar_internal_metadata", primary_key: "key", force: :cascade do |t|
    t.string   "value",      limit: 255
    t.datetime "created_at",             null: false
    t.datetime "updated_at",             null: false
  end

  create_table "arch_stats", force: :cascade do |t|
    t.integer  "user_id",            limit: 4
    t.integer  "image_id",           limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
    t.boolean  "delta"
    t.integer  "operation_label_id", limit: 4
  end

  add_index "arch_stats", ["image_id"], name: "index_arch_stats_on_image_id", using: :btree
  add_index "arch_stats", ["user_id"], name: "index_arch_stats_on_user_id", using: :btree

  create_table "authorizations", force: :cascade do |t|
    t.integer  "permission_label_id",     limit: 4
    t.integer  "title_provider_group_id", limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "authorizations", ["permission_label_id", "title_provider_group_id"], name: "index_unique_provider_group_authorization", unique: true, using: :btree

  create_table "authorized_countries", force: :cascade do |t|
    t.integer  "provider_id", limit: 4
    t.integer  "country_id",  limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "billing_informations", force: :cascade do |t|
    t.integer  "user_id",            limit: 4,   null: false
    t.string   "billing_company",    limit: 255
    t.string   "billing_address",    limit: 255
    t.string   "billing_zip_code",   limit: 255
    t.string   "billing_city",       limit: 255
    t.integer  "billing_country_id", limit: 4
    t.string   "billing_email",      limit: 255
    t.datetime "created_at",                     null: false
    t.datetime "updated_at",                     null: false
    t.string   "siret",              limit: 255
  end

  create_table "communication_in_jobs", force: :cascade do |t|
    t.string   "job_source",        limit: 255
    t.integer  "job_source_job_id", limit: 4
    t.string   "type",              limit: 255
    t.text     "params",            limit: 65535
    t.integer  "done",              limit: 4
    t.string   "result",            limit: 255
    t.datetime "created_at",                      null: false
    t.datetime "updated_at",                      null: false
  end

  create_table "communication_out_jobs", force: :cascade do |t|
    t.string   "type",       limit: 255
    t.text     "params",     limit: 65535
    t.integer  "done",       limit: 4
    t.string   "result",     limit: 255
    t.datetime "created_at",               null: false
    t.datetime "updated_at",               null: false
  end

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

  create_table "delayed_jobs", force: :cascade do |t|
    t.integer  "priority",   limit: 4,     default: 0
    t.integer  "attempts",   limit: 4,     default: 0
    t.text     "handler",    limit: 65535
    t.text     "last_error", limit: 65535
    t.datetime "run_at"
    t.datetime "locked_at"
    t.datetime "failed_at"
    t.string   "locked_by",  limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "queue",      limit: 255
  end

  create_table "images", force: :cascade do |t|
    t.string   "title",                  limit: 192
    t.string   "subject_code",           limit: 708
    t.text     "subject",                limit: 65535
    t.string   "instructions",           limit: 768
    t.string   "creator",                limit: 96
    t.string   "city",                   limit: 96
    t.string   "location",               limit: 96
    t.string   "state",                  limit: 96
    t.string   "country",                limit: 192
    t.string   "headline",               limit: 768
    t.string   "credit",                 limit: 96
    t.string   "source",                 limit: 96
    t.text     "description",            limit: 65535
    t.string   "reportage",              limit: 96
    t.string   "normalized_credit",      limit: 192
    t.integer  "max_avail_width",        limit: 4
    t.integer  "max_avail_height",       limit: 4
    t.string   "original_filename",      limit: 255
    t.text     "provider_comment",       limit: 65535
    t.datetime "date_created"
    t.datetime "reception_date"
    t.string   "thumb_location",         limit: 255
    t.string   "medium_location",        limit: 255
    t.string   "hires_location",         limit: 1000
    t.string   "restrictions",           limit: 512,   default: "ANY"
    t.integer  "provider_id",            limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "rights",                 limit: 384
    t.string   "category",               limit: 9
    t.string   "supplemental_category",  limit: 96
    t.integer  "urgency",                limit: 3
    t.string   "authors_position",       limit: 96
    t.string   "transmission_reference", limit: 96
    t.string   "caption_writer",         limit: 96
    t.boolean  "delta",                                default: true,  null: false
    t.float    "ratio",                  limit: 24
    t.boolean  "erasable",                             default: false
    t.string   "ms_picture_id",          limit: 255
    t.string   "ms_id",                  limit: 255
    t.boolean  "private_image",                        default: false
    t.string   "file_name",              limit: 255
    t.boolean  "content_error",                        default: false, null: false
    t.integer  "ms_image_id",            limit: 4,     default: 0
    t.integer  "fonds",                  limit: 4,     default: 0
    t.integer  "hr_size",                limit: 4,     default: 0
    t.integer  "black_and_white",        limit: 1,     default: 0
    t.integer  "flow",                   limit: 1,     default: 0
    t.string   "id20min",                limit: 255
    t.integer  "pp_category_id",         limit: 1,     default: 0
    t.integer  "right_owner_id",         limit: 4
  end

  add_index "images", ["black_and_white"], name: "black_and_white", using: :btree
  add_index "images", ["content_error"], name: "index_images_on_content_error", using: :btree
  add_index "images", ["created_at"], name: "index_images_on_created_at", using: :btree
  add_index "images", ["date_created"], name: "index_images_on_date_created", using: :btree
  add_index "images", ["delta"], name: "index_images_on_delta", using: :btree
  add_index "images", ["file_name"], name: "index_images_on_file_name", using: :btree
  add_index "images", ["flow"], name: "index_images_on_flow", using: :btree
  add_index "images", ["ms_id", "ms_picture_id"], name: "ms_id_i", using: :btree
  add_index "images", ["ms_image_id"], name: "index_images_on_ms_image_id", unique: true, using: :btree
  add_index "images", ["original_filename", "provider_id"], name: "index_images_on_original_filename_and_provider_id", unique: true, using: :btree
  add_index "images", ["pp_category_id"], name: "index_images_on_pp_category_id", using: :btree
  add_index "images", ["private_image"], name: "index_images_on_private_image", using: :btree
  add_index "images", ["provider_id"], name: "index_images_on_provider_id", using: :btree
  add_index "images", ["ratio"], name: "index_images_on_ratio", using: :btree
  add_index "images", ["reception_date"], name: "index_images_on_reception_date", using: :btree
  add_index "images", ["reportage"], name: "index_images_on_reportage", using: :btree
  add_index "images", ["right_owner_id"], name: "index_images_on_right_owner_id", using: :btree
  add_index "images", ["updated_at"], name: "index_images_on_updated_at", using: :btree

  create_table "inv_billing_companies", force: :cascade do |t|
    t.string   "billing_company",    limit: 255
    t.string   "billing_address",    limit: 255
    t.string   "billing_zip_code",   limit: 255
    t.string   "billing_city",       limit: 255
    t.integer  "billing_country_id", limit: 4
    t.string   "billing_email",      limit: 255
    t.datetime "created_at",                                       null: false
    t.datetime "updated_at",                                       null: false
    t.string   "billing_phone",      limit: 255
    t.string   "billing_complement", limit: 255
    t.integer  "discount",           limit: 4
    t.integer  "vat_id",             limit: 4
    t.string   "vat_number",         limit: 255
    t.boolean  "distributor",                      default: false, null: false
    t.string   "bank_account",       limit: 255
    t.integer  "payment_type_id",    limit: 4
    t.integer  "time_limit",         limit: 4
    t.boolean  "end_of_month",                     default: false, null: false
    t.string   "siret",              limit: 255
    t.text     "comment",            limit: 65535
  end

  create_table "inv_billing_lines", force: :cascade do |t|
    t.integer "billing_id",        limit: 4,                                              null: false
    t.integer "product_type_id",   limit: 4,                                              null: false
    t.integer "image_id",          limit: 4
    t.text    "description",       limit: 65535
    t.integer "right_owner_id",    limit: 4
    t.integer "photographer_rate", limit: 4
    t.integer "quantity",          limit: 4,                              default: 1,     null: false
    t.decimal "price",                           precision: 10, scale: 3, default: 0.0,   null: false
    t.decimal "vat",                             precision: 10, scale: 3, default: 0.0,   null: false
    t.decimal "discount",                        precision: 10, scale: 3, default: 0.0,   null: false
    t.decimal "total_ht",                        precision: 10, scale: 3, default: 0.0,   null: false
    t.decimal "total_ttc",                       precision: 10, scale: 3, default: 0.0,   null: false
    t.boolean "retribution",                                              default: false, null: false
    t.text    "usage",             limit: 65535
  end

  create_table "inv_billing_settings", force: :cascade do |t|
    t.string   "type",             limit: 255,                          default: "", null: false
    t.string   "code",             limit: 255
    t.string   "name",             limit: 255,                          default: "", null: false
    t.integer  "ordering",         limit: 4,                            default: 0,  null: false
    t.decimal  "amount",                       precision: 10, scale: 3
    t.boolean  "retribution"
    t.datetime "created_at",                                                         null: false
    t.datetime "updated_at",                                                         null: false
    t.integer  "ttv_id",           limit: 4
    t.integer  "ctv_id",           limit: 4
    t.date     "application_date"
    t.boolean  "photo"
  end

  add_index "inv_billing_settings", ["type"], name: "type", using: :btree

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

  create_table "inv_billings", force: :cascade do |t|
    t.integer  "billing_type_id",       limit: 4,                                              null: false
    t.string   "number",                limit: 255
    t.string   "sub_number",            limit: 255
    t.integer  "billing_company_id",    limit: 4
    t.date     "date"
    t.date     "deadline"
    t.decimal  "paid",                                precision: 10, scale: 3, default: 0.0,   null: false
    t.integer  "discount_type_id",      limit: 4,                                              null: false
    t.text     "conditions",            limit: 65535
    t.decimal  "total_before_discount",               precision: 10, scale: 3, default: 0.0,   null: false
    t.decimal  "discount",                            precision: 10, scale: 3, default: 0.0,   null: false
    t.decimal  "total",                               precision: 10, scale: 3, default: 0.0,   null: false
    t.decimal  "general_discount",                    precision: 10, scale: 3, default: 0.0,   null: false
    t.decimal  "total_ht_final",                      precision: 10, scale: 3, default: 0.0,   null: false
    t.decimal  "vat",                                 precision: 10, scale: 3, default: 0.0,   null: false
    t.decimal  "total_ttc",                           precision: 10, scale: 3, default: 0.0,   null: false
    t.string   "state",                 limit: 255,                            default: "",    null: false
    t.text     "heading",               limit: 65535
    t.integer  "logo_id",               limit: 4
    t.integer  "credit_note_id",        limit: 4
    t.integer  "price_type_id",         limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
    t.boolean  "synced_to_4d",                                                 default: false, null: false
  end

  create_table "inv_closing_amounts", force: :cascade do |t|
    t.integer  "closing_id",           limit: 4,                            null: false
    t.decimal  "vat_rate",                         precision: 10, scale: 3, null: false
    t.decimal  "grand_vat_total",                  precision: 10, scale: 3, null: false
    t.decimal  "perpetual_vat_total",              precision: 10, scale: 3, null: false
    t.string   "hash_string",          limit: 255
    t.string   "previous_hash_string", limit: 255
    t.datetime "created_at",                                                null: false
    t.datetime "updated_at",                                                null: false
  end

  add_index "inv_closing_amounts", ["closing_id"], name: "index_inv_closing_amounts_on_closing_id", using: :btree

  create_table "inv_closings", force: :cascade do |t|
    t.datetime "closing_date",                                              null: false
    t.decimal  "cumulative_total",                 precision: 10, scale: 3, null: false
    t.decimal  "perpetual_total",                  precision: 10, scale: 3, null: false
    t.decimal  "grand_vat_total",                  precision: 10, scale: 3, null: false
    t.decimal  "perpetual_vat_total",              precision: 10, scale: 3, null: false
    t.string   "hash_string",          limit: 255
    t.string   "previous_hash_string", limit: 255
    t.datetime "created_at",                                                null: false
    t.datetime "updated_at",                                                null: false
  end

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

  create_table "inv_payment_amounts", force: :cascade do |t|
    t.integer  "payment_id",           limit: 4,                                            null: false
    t.decimal  "vat_rate",                           precision: 10, scale: 3, default: 0.0, null: false
    t.decimal  "vat",                                precision: 10, scale: 3, default: 0.0, null: false
    t.decimal  "total_ht",                           precision: 10, scale: 3, default: 0.0, null: false
    t.text     "hash_string",          limit: 65535
    t.text     "previous_hash_string", limit: 65535
    t.datetime "created_at",                                                                null: false
    t.datetime "updated_at",                                                                null: false
  end

  add_index "inv_payment_amounts", ["payment_id"], name: "index_inv_payment_amounts_on_payment_id", using: :btree

  create_table "inv_payment_lines", force: :cascade do |t|
    t.integer  "payment_id",           limit: 4,                                          null: false
    t.integer  "billing_id",           limit: 4,                                          null: false
    t.decimal  "amount",                           precision: 10, scale: 3, default: 0.0, null: false
    t.datetime "created_at",                                                              null: false
    t.datetime "updated_at",                                                              null: false
    t.string   "hash_string",          limit: 255
    t.string   "previous_hash_string", limit: 255
  end

  create_table "inv_payments", force: :cascade do |t|
    t.integer  "billing_company_id", limit: 4
    t.integer  "payment_type_id",    limit: 4,                                        null: false
    t.date     "payment_date",                                                        null: false
    t.decimal  "total",                        precision: 10, scale: 3, default: 0.0, null: false
    t.datetime "created_at",                                                          null: false
    t.datetime "updated_at",                                                          null: false
    t.integer  "cancel_payment_id",  limit: 4
  end

  add_index "inv_payments", ["cancel_payment_id"], name: "index_inv_payments_on_cancel_payment_id", using: :btree

  create_table "inv_photographer_billing_companies", force: :cascade do |t|
    t.integer  "user_id",            limit: 4,                     null: false
    t.string   "billing_company",    limit: 255
    t.string   "billing_address",    limit: 255
    t.string   "billing_zip_code",   limit: 255
    t.string   "billing_city",       limit: 255
    t.integer  "billing_country_id", limit: 4
    t.string   "billing_email",      limit: 255
    t.datetime "created_at",                                       null: false
    t.datetime "updated_at",                                       null: false
    t.string   "billing_phone",      limit: 255
    t.string   "billing_complement", limit: 255
    t.integer  "discount",           limit: 4
    t.integer  "vat_id",             limit: 4
    t.string   "vat_number",         limit: 255
    t.boolean  "distributor",                      default: false, null: false
    t.string   "bank_account",       limit: 255
    t.integer  "payment_type_id",    limit: 4
    t.integer  "time_limit",         limit: 4
    t.boolean  "end_of_month",                     default: false, null: false
    t.string   "siret",              limit: 255
    t.text     "comment",            limit: 65535
  end

  add_index "inv_photographer_billing_companies", ["user_id"], name: "index_inv_photographer_billing_companies_on_user_id", using: :btree

  create_table "inv_photographer_billing_lines", force: :cascade do |t|
    t.integer "photographer_billing_id", limit: 4,                                              null: false
    t.integer "product_type_id",         limit: 4,                                              null: false
    t.integer "image_id",                limit: 4
    t.text    "description",             limit: 65535
    t.integer "quantity",                limit: 4,                              default: 1,     null: false
    t.decimal "price",                                 precision: 10, scale: 3, default: 0.0,   null: false
    t.decimal "vat",                                   precision: 10, scale: 3, default: 0.0,   null: false
    t.decimal "discount",                              precision: 10, scale: 3, default: 0.0,   null: false
    t.decimal "total_ht",                              precision: 10, scale: 3, default: 0.0,   null: false
    t.decimal "total_ttc",                             precision: 10, scale: 3, default: 0.0,   null: false
    t.boolean "retribution",                                                    default: false, null: false
    t.text    "usage",                   limit: 65535
  end

  add_index "inv_photographer_billing_lines", ["photographer_billing_id"], name: "index_inv_photographer_billing_lines_on_photographer_billing_id", using: :btree

  create_table "inv_photographer_billing_settings", force: :cascade do |t|
    t.integer "user_id",         limit: 4
    t.string  "logo",            limit: 255
    t.text    "company_details", limit: 65535
    t.text    "bottom_text",     limit: 65535
  end

  add_index "inv_photographer_billing_settings", ["user_id"], name: "index_inv_photographer_billing_settings_on_user_id", using: :btree

  create_table "inv_photographer_billings", force: :cascade do |t|
    t.integer  "user_id",                         limit: 4,                                            null: false
    t.integer  "billing_type_id",                 limit: 4,                                            null: false
    t.string   "number",                          limit: 255
    t.string   "sub_number",                      limit: 255
    t.integer  "photographer_billing_company_id", limit: 4
    t.date     "date"
    t.date     "deadline"
    t.decimal  "paid",                                          precision: 10, scale: 3, default: 0.0, null: false
    t.integer  "discount_type_id",                limit: 4,                                            null: false
    t.text     "conditions",                      limit: 65535
    t.decimal  "total_before_discount",                         precision: 10, scale: 3, default: 0.0, null: false
    t.decimal  "discount",                                      precision: 10, scale: 3, default: 0.0, null: false
    t.decimal  "total",                                         precision: 10, scale: 3, default: 0.0, null: false
    t.decimal  "general_discount",                              precision: 10, scale: 3, default: 0.0, null: false
    t.decimal  "total_ht_final",                                precision: 10, scale: 3, default: 0.0, null: false
    t.decimal  "vat",                                           precision: 10, scale: 3, default: 0.0, null: false
    t.decimal  "total_ttc",                                     precision: 10, scale: 3, default: 0.0, null: false
    t.text     "state",                           limit: 65535,                                        null: false
    t.text     "heading",                         limit: 65535
    t.integer  "credit_note_id",                  limit: 4
    t.integer  "price_type_id",                   limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "inv_photographer_billings", ["photographer_billing_company_id"], name: "index_photographer_billing_company_id", using: :btree
  add_index "inv_photographer_billings", ["user_id"], name: "index_inv_photographer_billings_on_user_id", using: :btree

  create_table "inv_photographer_closing_amounts", force: :cascade do |t|
    t.integer  "photographer_closing_id", limit: 4,                            null: false
    t.decimal  "vat_rate",                            precision: 10, scale: 3, null: false
    t.decimal  "grand_vat_total",                     precision: 10, scale: 3, null: false
    t.decimal  "perpetual_vat_total",                 precision: 10, scale: 3, null: false
    t.string   "hash_string",             limit: 255
    t.string   "previous_hash_string",    limit: 255
    t.datetime "created_at",                                                   null: false
    t.datetime "updated_at",                                                   null: false
  end

  add_index "inv_photographer_closing_amounts", ["photographer_closing_id"], name: "index_photographer_closing_id", using: :btree

  create_table "inv_photographer_closings", force: :cascade do |t|
    t.datetime "closing_date",                                              null: false
    t.decimal  "cumulative_total",                 precision: 10, scale: 3, null: false
    t.decimal  "perpetual_total",                  precision: 10, scale: 3, null: false
    t.decimal  "grand_vat_total",                  precision: 10, scale: 3, null: false
    t.decimal  "perpetual_vat_total",              precision: 10, scale: 3, null: false
    t.string   "hash_string",          limit: 255
    t.string   "previous_hash_string", limit: 255
    t.datetime "created_at",                                                null: false
    t.datetime "updated_at",                                                null: false
  end

  create_table "inv_photographer_payment_amounts", force: :cascade do |t|
    t.integer  "photographer_payment_id", limit: 4,                                            null: false
    t.decimal  "vat_rate",                              precision: 10, scale: 3, default: 0.0, null: false
    t.decimal  "vat",                                   precision: 10, scale: 3, default: 0.0, null: false
    t.decimal  "total_ht",                              precision: 10, scale: 3, default: 0.0, null: false
    t.text     "hash_string",             limit: 65535
    t.text     "previous_hash_string",    limit: 65535
    t.datetime "created_at",                                                                   null: false
    t.datetime "updated_at",                                                                   null: false
  end

  add_index "inv_photographer_payment_amounts", ["photographer_payment_id"], name: "index_photographer_payment_id", using: :btree

  create_table "inv_photographer_payment_lines", force: :cascade do |t|
    t.integer  "photographer_payment_id", limit: 4,                                          null: false
    t.integer  "photographer_billing_id", limit: 4,                                          null: false
    t.decimal  "amount",                              precision: 10, scale: 3, default: 0.0, null: false
    t.datetime "created_at",                                                                 null: false
    t.datetime "updated_at",                                                                 null: false
    t.string   "hash_string",             limit: 255
    t.string   "previous_hash_string",    limit: 255
  end

  add_index "inv_photographer_payment_lines", ["photographer_billing_id"], name: "index_inv_photographer_payment_lines_on_photographer_billing_id", using: :btree
  add_index "inv_photographer_payment_lines", ["photographer_payment_id"], name: "index_inv_photographer_payment_lines_on_photographer_payment_id", using: :btree

  create_table "inv_photographer_payments", force: :cascade do |t|
    t.integer  "user_id",                         limit: 4,                                        null: false
    t.integer  "photographer_billing_company_id", limit: 4,                                        null: false
    t.integer  "payment_type_id",                 limit: 4,                                        null: false
    t.date     "payment_date",                                                                     null: false
    t.decimal  "total",                                     precision: 10, scale: 3, default: 0.0, null: false
    t.datetime "created_at",                                                                       null: false
    t.datetime "updated_at",                                                                       null: false
    t.integer  "cancel_payment_id",               limit: 4
  end

  add_index "inv_photographer_payments", ["cancel_payment_id"], name: "index_inv_photographer_payments_on_cancel_payment_id", using: :btree
  add_index "inv_photographer_payments", ["photographer_billing_company_id"], name: "index_photographer_billing_company_id", using: :btree
  add_index "inv_photographer_payments", ["user_id"], name: "index_inv_photographer_payments_on_user_id", using: :btree

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

  create_table "inv_right_owners", force: :cascade do |t|
    t.string   "first_name",             limit: 255
    t.string   "last_name",              limit: 255
    t.string   "complement",             limit: 255
    t.string   "address",                limit: 255
    t.string   "zip_code",               limit: 255
    t.string   "city",                   limit: 255
    t.integer  "country_id",             limit: 4
    t.string   "phone",                  limit: 255
    t.string   "mobile",                 limit: 255
    t.string   "email",                  limit: 255
    t.integer  "language_id",            limit: 4
    t.integer  "right_owner_type_id",    limit: 4
    t.integer  "provider_id",            limit: 4
    t.integer  "currency_id",            limit: 4
    t.integer  "france_rate",            limit: 4,   default: 0,     null: false
    t.integer  "foreign_rate",           limit: 4,   default: 0,     null: false
    t.boolean  "avp",                                default: false, null: false
    t.boolean  "csg",                                default: false, null: false
    t.integer  "vat_id",                 limit: 4
    t.integer  "withholding_tax_id",     limit: 4
    t.datetime "created_at",                                         null: false
    t.datetime "updated_at",                                         null: false
    t.string   "creator_label",          limit: 255
    t.string   "author_code",            limit: 255
    t.string   "social_security_number", limit: 255
    t.string   "account_number",         limit: 255
    t.boolean  "dispense_precompte",                 default: false, null: false
    t.string   "vat_number",             limit: 255
    t.string   "siret",                  limit: 255
    t.string   "agessa_number",          limit: 255
  end

  create_table "inv_simulations", force: :cascade do |t|
    t.text     "params",     limit: 65535
    t.string   "status",     limit: 255,   default: "unprocessed"
    t.text     "error",      limit: 65535
    t.datetime "created_at",                                       null: false
    t.datetime "updated_at",                                       null: false
  end

  create_table "inv_statement_lines", force: :cascade do |t|
    t.integer  "statement_id",     limit: 4,                          null: false
    t.integer  "resource_line_id", limit: 4
    t.integer  "billing_line_id",  limit: 4,                          null: false
    t.decimal  "base",                       precision: 10, scale: 3, null: false
    t.decimal  "rate",                       precision: 10, scale: 3, null: false
    t.decimal  "amount",                     precision: 10, scale: 3, null: false
    t.datetime "created_at",                                          null: false
    t.datetime "updated_at",                                          null: false
  end

  create_table "inv_statements", force: :cascade do |t|
    t.date     "date"
    t.integer  "right_owner_id",   limit: 4
    t.string   "number",           limit: 255
    t.string   "status",           limit: 255,                          default: "pending"
    t.decimal  "total_fees",                   precision: 10, scale: 3
    t.decimal  "total_rights",                 precision: 10, scale: 3
    t.decimal  "total_sales",                  precision: 10, scale: 3
    t.decimal  "total_paid",                   precision: 10, scale: 3
    t.decimal  "total",                        precision: 10, scale: 3
    t.decimal  "avp_rate",                     precision: 10, scale: 3
    t.decimal  "avp_amount",                   precision: 10, scale: 3
    t.decimal  "base_fee_rate",                precision: 10, scale: 3
    t.decimal  "base_fee_amount",              precision: 10, scale: 3
    t.decimal  "csg_rate",                     precision: 10, scale: 3
    t.decimal  "csg_amount",                   precision: 10, scale: 3
    t.decimal  "rds_rate",                     precision: 10, scale: 3
    t.decimal  "rds_amount",                   precision: 10, scale: 3
    t.decimal  "ret_rate",                     precision: 10, scale: 3
    t.decimal  "ret_amount",                   precision: 10, scale: 3
    t.decimal  "vat_rate",                     precision: 10, scale: 3
    t.decimal  "vat_amount",                   precision: 10, scale: 3
    t.integer  "payment_type_id",  limit: 4
    t.date     "payment_date"
    t.datetime "created_at",                                                                null: false
    t.datetime "updated_at",                                                                null: false
    t.string   "fees_description", limit: 255
    t.decimal  "fees_amount",                  precision: 10, scale: 3
    t.boolean  "fees_addition",                                         default: false,     null: false
  end

  create_table "iptc_countries", force: :cascade do |t|
    t.string "code", limit: 255
    t.string "en",   limit: 255
    t.string "fr",   limit: 255
  end

  create_table "light_box_images", force: :cascade do |t|
    t.string   "annotation",   limit: 255
    t.integer  "light_box_id", limit: 4
    t.integer  "image_id",     limit: 4
    t.integer  "position",     limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "light_box_images", ["image_id"], name: "index_light_box_images_on_image_id", using: :btree
  add_index "light_box_images", ["light_box_id"], name: "index_light_box_images_on_light_box_id", using: :btree

  create_table "light_boxes", force: :cascade do |t|
    t.boolean  "order_by_agency",             default: false
    t.string   "name",            limit: 255
    t.integer  "user_id",         limit: 4
    t.integer  "title_id",        limit: 4
    t.string   "hash_code",       limit: 255
    t.integer  "items_count",     limit: 4,   default: 0
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "permission",      limit: 1,   default: 0
  end

  add_index "light_boxes", ["name"], name: "index_light_boxes_on_name", using: :btree
  add_index "light_boxes", ["user_id"], name: "index_light_boxes_on_user_id", using: :btree

  create_table "locales", force: :cascade do |t|
    t.string "key",     limit: 255,   null: false
    t.text   "text_en", limit: 65535
    t.text   "text_fr", limit: 65535
  end

  add_index "locales", ["key"], name: "index_locales_on_key", unique: true, using: :btree

  create_table "metadata_conversions", force: :cascade do |t|
    t.string "image",    limit: 255
    t.string "iptc",     limit: 255
    t.string "eightbim", limit: 255
    t.string "xmp",      limit: 255
  end

  create_table "net_messages", force: :cascade do |t|
    t.text     "message",     limit: 65535,                 null: false
    t.text     "answer",      limit: 65535
    t.datetime "answered_at"
    t.boolean  "skipable",                  default: false, null: false
    t.integer  "server_id",   limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

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

  create_table "paniers", force: :cascade do |t|
    t.integer "reportage_id", limit: 4, null: false
    t.integer "user_id",      limit: 4, null: false
  end

  add_index "paniers", ["reportage_id"], name: "index_paniers_on_reportage_id", using: :btree
  add_index "paniers", ["user_id"], name: "index_paniers_on_user_id", using: :btree

  create_table "parameters", force: :cascade do |t|
    t.string "key",   limit: 255, null: false
    t.string "value", limit: 255
  end

  add_index "parameters", ["key"], name: "index_parameters_on_key", unique: true, using: :btree

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

  create_table "photos", force: :cascade do |t|
    t.string   "photo",       limit: 255
    t.integer  "user_id",     limit: 4
    t.string   "description", limit: 255
    t.string   "credit",      limit: 255
    t.string   "city",        limit: 255
    t.date     "date_photo"
    t.string   "reportage",   limit: 255
    t.string   "keywords",    limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "up_country",  limit: 255, default: ""
    t.string   "source",      limit: 255, default: ""
  end

  add_index "photos", ["user_id"], name: "index_photos_on_user_id", using: :btree

  create_table "pixtech_params", force: :cascade do |t|
    t.string   "name",       limit: 255
    t.text     "value",      limit: 65535
    t.integer  "pixtech_id", limit: 4
    t.datetime "created_at",               null: false
    t.datetime "updated_at",               null: false
  end

  add_index "pixtech_params", ["pixtech_id"], name: "index_pixtech_params_on_pixtech_id", using: :btree

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

  add_index "pixteches", ["name"], name: "index_pixteches_on_name", unique: true, using: :btree

  create_table "pp_categories", force: :cascade do |t|
    t.string   "label",      limit: 20
    t.datetime "created_at",            null: false
    t.datetime "updated_at",            null: false
  end

  create_table "prov_to_apis", force: :cascade do |t|
    t.string "login",      limit: 255
    t.string "mot_passe",  limit: 255
    t.string "string_key", limit: 255
    t.string "email",      limit: 255
  end

  add_index "prov_to_apis", ["email"], name: "index_prov_to_apis_on_email", using: :btree
  add_index "prov_to_apis", ["login"], name: "index_prov_to_apis_on_login", using: :btree
  add_index "prov_to_apis", ["string_key"], name: "index_prov_to_apis_on_string_key", using: :btree

  create_table "provider_contacts", force: :cascade do |t|
    t.boolean  "main"
    t.string   "first_name",       limit: 255
    t.string   "last_name",        limit: 255
    t.string   "email",            limit: 100
    t.string   "fax",              limit: 255
    t.string   "phone",            limit: 255
    t.boolean  "receive_requests"
    t.integer  "provider_id",      limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "portable",         limit: 255
    t.boolean  "receive_stat"
    t.boolean  "receive_errors",               default: false
    t.boolean  "receive_demand",               default: false
    t.integer  "receive_alert",    limit: 1,   default: 0
  end

  create_table "provider_for_search_stats", force: :cascade do |t|
    t.integer "search_stat_id", limit: 4,     default: 0
    t.integer "provider_id",    limit: 4,     default: 0
    t.integer "result",         limit: 4,     default: 0
    t.text    "provs",          limit: 65535
  end

  add_index "provider_for_search_stats", ["provider_id"], name: "index_provider_for_search_stats_on_provider_id", using: :btree
  add_index "provider_for_search_stats", ["search_stat_id"], name: "index_provider_for_search_stats_on_search_stat_id", using: :btree

  create_table "provider_response_to_requests", force: :cascade do |t|
    t.integer  "request_to_provider_id", limit: 4
    t.integer  "image_id",               limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "provider_response_to_requests", ["request_to_provider_id"], name: "index_provider_response_to_requests_on_request_to_provider_id", using: :btree

  create_table "provider_types", force: :cascade do |t|
    t.string "name", limit: 255
  end

  create_table "providers", force: :cascade do |t|
    t.string   "name",                  limit: 255
    t.string   "logo",                  limit: 255
    t.string   "description",           limit: 750
    t.string   "site",                  limit: 255
    t.string   "address",               limit: 255
    t.boolean  "local",                             default: false
    t.string   "copyright_rule",        limit: 255
    t.string   "string_key",            limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "days_keep",             limit: 4
    t.boolean  "days_keep_per_picture",             default: false
    t.boolean  "form_per_session",                  default: false
    t.string   "provider_conditions",   limit: 255
    t.string   "input_dir",             limit: 255
    t.string   "city",                  limit: 255
    t.string   "country",               limit: 255
    t.string   "zip_code",              limit: 255
    t.string   "text_prices_url",       limit: 255
    t.boolean  "actif",                             default: true
    t.integer  "toomany_limit",         limit: 4,   default: 0
    t.boolean  "in_pixtrakk",                       default: true
    t.string   "pp_name",               limit: 255
    t.string   "pdf",                   limit: 255
    t.string   "formu",                 limit: 255
    t.string   "name_order",            limit: 255
    t.string   "cgv",                   limit: 255, default: ""
    t.boolean  "exhaustivity",                      default: false
    t.integer  "provider_type_id",      limit: 4,   default: 1
    t.string   "pp_string_key",         limit: 255
    t.integer  "pixtech_id",            limit: 4
    t.integer  "days_keep_alert",       limit: 4
    t.integer  "toomany_limit_alert",   limit: 4,   default: 0
    t.boolean  "visible",                           default: true,  null: false
    t.boolean  "copyright_symbol",                  default: true
  end

  add_index "providers", ["pixtech_id"], name: "index_providers_on_pixtech_id", using: :btree
  add_index "providers", ["pp_name"], name: "index_providers_on_pp_name", using: :btree

  create_table "refresh_providers", force: :cascade do |t|
    t.integer  "provider_id",  limit: 4
    t.integer  "total_update", limit: 4, default: 0
    t.integer  "nb_updated",   limit: 4, default: 0
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "refresh_providers", ["provider_id"], name: "index_refresh_providers_on_provider_id", using: :btree

  create_table "reportage_photos", force: :cascade do |t|
    t.integer "reportage_id", limit: 4
    t.integer "photo_ms_id",  limit: 8
    t.integer "rang",         limit: 4, default: 0
  end

  add_index "reportage_photos", ["photo_ms_id"], name: "index_reportage_photos_on_photo_ms_id", using: :btree
  add_index "reportage_photos", ["reportage_id"], name: "index_reportage_photos_on_reportage_id", using: :btree

  create_table "reportages", force: :cascade do |t|
    t.string   "no_reportage", limit: 255
    t.string   "string_key",   limit: 70
    t.integer  "nb_photos",    limit: 4,     default: 0
    t.integer  "prem_photo",   limit: 8,                     null: false
    t.string   "rep_titre",    limit: 192
    t.text     "rep_texte",    limit: 65535
    t.date     "rep_date"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "signatur",     limit: 192
    t.boolean  "offre",                      default: false
    t.boolean  "visible",                    default: true
  end

  add_index "reportages", ["nb_photos"], name: "index_reportages_on_nb_photos", using: :btree
  add_index "reportages", ["no_reportage"], name: "index_reportages_on_no_reportage", using: :btree
  add_index "reportages", ["offre"], name: "index_reportages_on_offre", using: :btree
  add_index "reportages", ["rep_date"], name: "index_reportages_on_rep_date", using: :btree
  add_index "reportages", ["rep_titre"], name: "index_reportages_on_rep_titre", using: :btree
  add_index "reportages", ["signatur"], name: "index_reportages_on_signatur", using: :btree
  add_index "reportages", ["string_key"], name: "index_reportages_on_string_key", using: :btree
  add_index "reportages", ["visible"], name: "index_reportages_on_visible", using: :btree

  create_table "reqphotos", force: :cascade do |t|
    t.string   "reqphoto_file_name",     limit: 100
    t.string   "reqphoto_content_type",  limit: 20
    t.integer  "reqphoto_file_size",     limit: 4
    t.datetime "reqphoto_updated_at"
    t.integer  "request_to_provider_id", limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "copied_to_ms",           limit: 4,   default: 0
  end

  add_index "reqphotos", ["request_to_provider_id"], name: "index_reqphotos_on_request_to_provider_id", using: :btree

  create_table "request_to_providers", force: :cascade do |t|
    t.string   "text",            limit: 255
    t.date     "view_date"
    t.string   "status",          limit: 255
    t.string   "subject",         limit: 255
    t.integer  "responses_count", limit: 4,   default: 0
    t.integer  "user_id",         limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "serial",          limit: 255
  end

  add_index "request_to_providers", ["user_id"], name: "index_request_to_providers_on_user_id", using: :btree

  create_table "roles", force: :cascade do |t|
    t.string   "name",        limit: 255
    t.text     "permissions", limit: 65535
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "saved_searches", force: :cascade do |t|
    t.integer  "user_id",          limit: 4
    t.string   "name",             limit: 255
    t.datetime "date"
    t.datetime "date_last_search"
    t.integer  "photos_count",     limit: 4
    t.text     "criteria",         limit: 65535
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "search_image_fields", force: :cascade do |t|
    t.integer "search_stat_id", limit: 4,     default: 0
    t.string  "field_name",     limit: 50
    t.string  "field_content",  limit: 100
    t.text    "iptc",           limit: 65535
  end

  add_index "search_image_fields", ["search_stat_id"], name: "index_search_image_fields_on_search_stat_id", using: :btree

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

  add_index "search_provider_group_names", ["name", "user_id"], name: "index_search_provider_group_names_on_name_and_user_id", unique: true, using: :btree

  create_table "search_provider_groups", force: :cascade do |t|
    t.integer  "provider_id",                   limit: 4
    t.integer  "search_provider_group_name_id", limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "search_stats", force: :cascade do |t|
    t.string   "keyword",         limit: 255
    t.string   "since",           limit: 50
    t.string   "tri",             limit: 50
    t.date     "date_pp_from"
    t.date     "date_pp_to"
    t.date     "date_photo_from"
    t.date     "date_photo_to"
    t.integer  "format",          limit: 4
    t.integer  "result",          limit: 4,   default: 0
    t.integer  "user_id",         limit: 4
    t.datetime "created_at"
    t.string   "serv_name",       limit: 100
    t.integer  "cs_stat_id",      limit: 4,   default: 0
    t.datetime "cs_created"
    t.string   "translation",     limit: 255
    t.string   "special_filter",  limit: 255
  end

  add_index "search_stats", ["result"], name: "index_search_stats_on_result", using: :btree
  add_index "search_stats", ["user_id"], name: "index_search_stats_on_user_id", using: :btree

  create_table "selected_providers_for_requests", force: :cascade do |t|
    t.integer  "request_to_provider_id", limit: 4
    t.integer  "provider_id",            limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "servers", force: :cascade do |t|
    t.string   "status",         limit: 255
    t.string   "host",           limit: 255
    t.string   "name",           limit: 255
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "which_type",     limit: 255
    t.boolean  "is_self",                    default: false,  null: false
    t.string   "api_key",        limit: 255
    t.string   "api_port",       limit: 255, default: "5671", null: false
    t.string   "public_url",     limit: 255
    t.string   "internal_url",   limit: 255
    t.string   "backoffice_url", limit: 255
  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", ["session_id"], name: "index_sessions_on_session_id", unique: true, using: :btree
  add_index "sessions", ["updated_at"], name: "index_sessions_on_updated_at", using: :btree

  create_table "settings", force: :cascade do |t|
    t.string   "language",              limit: 255
    t.text     "preferential_corpus",   limit: 65535
    t.text     "display_params",        limit: 65535
    t.text     "border_color_provider", limit: 65535
    t.integer  "user_id",               limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "time_zone",             limit: 255
    t.integer  "default_per_page",      limit: 4,     default: 0,                   null: false
    t.string   "default_since",         limit: 255,   default: "all",               null: false
    t.string   "default_sort",          limit: 255,   default: "reception_date",    null: false
    t.integer  "reload_pref",           limit: 4,     default: 0
    t.string   "default_media",         limit: 255,   default: "all"
    t.boolean  "pagination",                          default: true
    t.string   "under_my_thumb",        limit: 255,   default: "normalized_credit"
  end

  add_index "settings", ["user_id"], name: "index_settings_on_user_id", using: :btree

  create_table "shortened_urls", force: :cascade do |t|
    t.integer  "owner_id",   limit: 4
    t.string   "owner_type", limit: 20
    t.text     "url",        limit: 65535,             null: false
    t.string   "unique_key", limit: 10,                null: false
    t.string   "category",   limit: 255
    t.integer  "use_count",  limit: 4,     default: 0, null: false
    t.datetime "expires_at"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "shortened_urls", ["category"], name: "index_shortened_urls_on_category", using: :btree
  add_index "shortened_urls", ["owner_id", "owner_type"], name: "index_shortened_urls_on_owner_id_and_owner_type", using: :btree
  add_index "shortened_urls", ["unique_key"], name: "index_shortened_urls_on_unique_key", unique: true, using: :btree
  add_index "shortened_urls", ["url"], name: "index_shortened_urls_on_url", length: {"url"=>767}, using: :btree

  create_table "statistics", force: :cascade do |t|
    t.integer  "user_id",            limit: 4
    t.integer  "image_id",           limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
    t.boolean  "delta",                        default: true
    t.integer  "operation_label_id", limit: 4
  end

  add_index "statistics", ["image_id"], name: "index_statistics_on_image_id", using: :btree
  add_index "statistics", ["user_id"], name: "index_statistics_on_user_id", using: :btree

  create_table "title_provider_group_names", force: :cascade do |t|
    t.string   "name",       limit: 255
    t.integer  "country_id", limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "title_provider_group_names", ["name", "country_id"], name: "index_title_provider_group_names_on_name_and_country_id", unique: true, using: :btree

  create_table "title_provider_groups", force: :cascade do |t|
    t.integer  "title_provider_group_name_id", limit: 4
    t.integer  "provider_id",                  limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "title_provider_groups", ["title_provider_group_name_id"], name: "index_title_provider_groups_on_title_provider_group_name_id", using: :btree

  create_table "titles", force: :cascade do |t|
    t.string   "name",                         limit: 255
    t.boolean  "hide_unauthorized_providers",              default: true
    t.integer  "dpi",                          limit: 4,   default: 75
    t.string   "flow_path",                    limit: 255
    t.integer  "title_provider_group_name_id", limit: 4
    t.integer  "server_id",                    limit: 4
    t.integer  "country_id",                   limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "first_name",                   limit: 100, default: ""
    t.string   "last_name",                    limit: 100, default: ""
    t.string   "address",                      limit: 150, default: ""
    t.string   "zip_code",                     limit: 10,  default: ""
    t.string   "city",                         limit: 150, default: ""
    t.string   "phone",                        limit: 20,  default: ""
    t.string   "email",                        limit: 100, default: ""
    t.string   "comment",                      limit: 500, default: ""
    t.integer  "visible",                      limit: 4,   default: 0
    t.string   "group",                        limit: 100, default: ""
    t.string   "title_type",                   limit: 100, default: ""
    t.string   "visible_name",                 limit: 100, default: ""
    t.string   "ojd_link",                     limit: 150, default: ""
    t.string   "status",                       limit: 255, default: "active", null: false
    t.integer  "billing_company_id",           limit: 4
  end

  add_index "titles", ["billing_company_id"], name: "index_titles_on_billing_company_id", using: :btree

  create_table "updated_list_providers", force: :cascade do |t|
    t.integer  "refresh_provider_id", limit: 4
    t.integer  "nb_photos",           limit: 4,   default: 0
    t.datetime "action_date"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "visionneuse",         limit: 255, default: ""
  end

  add_index "updated_list_providers", ["refresh_provider_id"], name: "index_updated_list_providers_on_refresh_provider_id", using: :btree

  create_table "users", force: :cascade do |t|
    t.string   "login",                     limit: 100
    t.string   "first_name",                limit: 100,   default: ""
    t.string   "last_name",                 limit: 100,   default: ""
    t.string   "email",                     limit: 100
    t.string   "crypted_password",          limit: 128,   default: "",       null: false
    t.string   "salt",                      limit: 128,   default: "",       null: false
    t.datetime "remember_token_expires_at"
    t.datetime "activated_at"
    t.string   "phone",                     limit: 255
    t.string   "fax",                       limit: 255
    t.integer  "numero_tva",                limit: 4,     default: 0
    t.string   "company",                   limit: 40
    t.string   "job",                       limit: 40
    t.string   "activity_sector",           limit: 60
    t.string   "service",                   limit: 40
    t.string   "billing_address",           limit: 255
    t.string   "billing_company",           limit: 255
    t.string   "city",                      limit: 255
    t.string   "password_reset_code",       limit: 255
    t.string   "zip_code",                  limit: 20
    t.text     "permissions",               limit: 65535
    t.integer  "title_id",                  limit: 4
    t.integer  "role_id",                   limit: 4
    t.integer  "country_id",                limit: 4
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "login_key",                 limit: 255
    t.string   "persistence_token",         limit: 255,                      null: false
    t.string   "perishable_token",          limit: 255,                      null: false
    t.integer  "login_count",               limit: 4
    t.integer  "failed_login_count",        limit: 4
    t.datetime "last_request_at"
    t.datetime "current_login_at"
    t.datetime "last_login_at"
    t.string   "current_login_ip",          limit: 255
    t.string   "last_login_ip",             limit: 255
    t.date     "deactivation_at"
    t.date     "password_updated_at"
    t.integer  "roles_mask",                limit: 4,     default: 4
    t.string   "address",                   limit: 255
    t.string   "status",                    limit: 255,   default: "active", null: false
    t.integer  "max_daily_downloads",       limit: 4,     default: 0,        null: false
    t.string   "civility",                  limit: 255
    t.string   "job_title",                 limit: 255
    t.string   "industry",                  limit: 255
    t.string   "position",                  limit: 255
    t.string   "reset_password_token",      limit: 255
    t.datetime "reset_password_sent_at"
  end

  add_index "users", ["email", "title_id"], name: "index_users_on_email_and_title_id", unique: true, using: :btree
  add_index "users", ["login"], name: "index_users_on_login", unique: true, using: :btree
  add_index "users", ["login_key"], name: "index_users_on_login_key", unique: true, using: :btree
  add_index "users", ["roles_mask"], name: "index_users_on_roles_mask", using: :btree

  add_foreign_key "pixtech_params", "pixteches"
end
