# 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 => 20130717000000) do

  create_table "admins", :force => true do |t|
    t.string   "email",                  :default => "", :null => false
    t.string   "encrypted_password",     :default => "", :null => false
    t.string   "reset_password_token"
    t.datetime "reset_password_sent_at"
    t.datetime "remember_created_at"
    t.integer  "sign_in_count",          :default => 0
    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.datetime "created_at",                             :null => false
    t.datetime "updated_at",                             :null => false
    t.string   "username"
    t.string   "name"
    t.string   "firstname"
    t.string   "file"
  end

  add_index "admins", ["email"], :name => "index_admins_on_email", :unique => true
  add_index "admins", ["reset_password_token"], :name => "index_admins_on_reset_password_token", :unique => true

  create_table "answer_sets", :force => true do |t|
    t.integer  "question_set_id"
    t.integer  "survey_item_answer_id"
    t.text     "content"
    t.boolean  "is_checked"
    t.datetime "created_at",            :null => false
    t.datetime "updated_at",            :null => false
    t.integer  "position"
  end

  add_index "answer_sets", ["question_set_id"], :name => "index_answer_sets_on_question_set_id"
  add_index "answer_sets", ["survey_item_answer_id"], :name => "index_answer_sets_on_survey_item_answer_id"

  create_table "donates", :force => true do |t|
    t.date     "paid_at"
    t.integer  "amount"
    t.integer  "payment_type"
    t.string   "bank"
    t.string   "check_number"
    t.text     "comment"
    t.integer  "sheet_id"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "forum_categories", :force => true do |t|
    t.string   "title"
    t.text     "description"
    t.integer  "parent_id"
    t.integer  "forum_id"
    t.datetime "created_at",  :null => false
    t.datetime "updated_at",  :null => false
  end

  create_table "forum_messages", :force => true do |t|
    t.integer  "forum_user_id"
    t.integer  "forum_topic_id"
    t.string   "title"
    t.text     "description"
    t.datetime "created_at",     :null => false
    t.datetime "updated_at",     :null => false
  end

  add_index "forum_messages", ["forum_user_id"], :name => "index_forum_messages_on_forum_user_id"

  create_table "forum_topics", :force => true do |t|
    t.integer  "forum_user_id"
    t.integer  "category_id"
    t.string   "title"
    t.text     "description"
    t.datetime "created_at",    :null => false
    t.datetime "updated_at",    :null => false
  end

  add_index "forum_topics", ["forum_user_id"], :name => "index_forum_topics_on_forum_user_id"

  create_table "forum_user_images", :force => true do |t|
    t.integer  "album_id_id"
    t.integer  "forum_user_id"
    t.string   "image"
    t.string   "title"
    t.integer  "views"
    t.text     "description"
    t.datetime "created_at",    :null => false
    t.datetime "updated_at",    :null => false
  end

  add_index "forum_user_images", ["album_id_id"], :name => "index_forum_user_images_on_album_id_id"
  add_index "forum_user_images", ["forum_user_id"], :name => "index_forum_user_images_on_forum_user_id"

  create_table "forum_users", :force => true do |t|
    t.string   "name"
    t.string   "firstname"
    t.text     "bio"
    t.string   "avatar"
    t.string   "email",                  :default => "", :null => false
    t.string   "password_digest",        :default => "", :null => false
    t.string   "reset_password_token"
    t.datetime "reset_password_sent_at"
    t.datetime "remember_created_at"
    t.integer  "sign_in_count",          :default => 0
    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.boolean  "lock"
    t.datetime "locked_at"
    t.datetime "created_at",                             :null => false
    t.datetime "updated_at",                             :null => false
  end

  create_table "forums", :force => true do |t|
    t.string   "title"
    t.text     "description"
    t.datetime "created_at",  :null => false
    t.datetime "updated_at",  :null => false
  end

  create_table "newsgroups", :force => true do |t|
    t.string   "name"
    t.text     "description"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "newsletters", :force => true do |t|
    t.string   "title"
    t.text     "content"
    t.datetime "sendmail"
    t.boolean  "archive"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
    t.string   "email_from"
  end

  create_table "note_files", :force => true do |t|
    t.string   "file"
    t.string   "name"
    t.string   "slug"
    t.text     "description"
    t.integer  "admin_id"
    t.integer  "note_id"
    t.datetime "created_at",  :null => false
    t.datetime "updated_at",  :null => false
  end

  create_table "notes", :force => true do |t|
    t.string   "subject"
    t.text     "message"
    t.integer  "admin_id"
    t.integer  "topic_id"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
  end

  add_index "notes", ["admin_id"], :name => "index_notes_on_admin_id"

  create_table "people", :force => true do |t|
    t.boolean  "newsletter"
    t.string   "surname"
    t.string   "firstname"
    t.string   "email"
    t.string   "phone"
    t.string   "job"
    t.integer  "sheet_id"
    t.integer  "positon"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "people_newsgroups", :force => true do |t|
    t.integer  "person_id"
    t.integer  "newsgroup_id"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "petition_signators", :force => true do |t|
    t.integer  "petition_id"
    t.string   "firstname"
    t.string   "name"
    t.string   "address"
    t.string   "address2"
    t.string   "cp"
    t.string   "city"
    t.string   "country"
    t.string   "email"
    t.boolean  "enabled"
    t.string   "token"
    t.datetime "created_at",  :null => false
    t.datetime "updated_at",  :null => false
  end

  add_index "petition_signators", ["petition_id"], :name => "index_petition_signators_on_petition_id"

  create_table "petitions", :force => true do |t|
    t.string   "name"
    t.text     "description"
    t.string   "slug"
    t.boolean  "enabled"
    t.datetime "created_at",  :null => false
    t.datetime "updated_at",  :null => false
  end

  create_table "question_sets", :force => true do |t|
    t.integer  "survey_item_id"
    t.integer  "survey_set_id"
    t.text     "content"
    t.boolean  "boolean_content"
    t.datetime "created_at",      :null => false
    t.datetime "updated_at",      :null => false
  end

  add_index "question_sets", ["survey_item_id"], :name => "index_question_sets_on_survey_item_id"
  add_index "question_sets", ["survey_set_id"], :name => "index_question_sets_on_survey_set_id"

  create_table "sheet_years", :force => true do |t|
    t.integer  "year"
    t.integer  "join_type"
    t.boolean  "gift_year"
    t.boolean  "benefactor"
    t.date     "paid_at"
    t.integer  "amount"
    t.integer  "payment_type"
    t.string   "bank"
    t.string   "check_number"
    t.integer  "sheet_id"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.boolean  "plume"
  end

  create_table "sheets", :force => true do |t|
    t.string   "corporate"
    t.string   "other_phone"
    t.string   "other_mail"
    t.string   "address"
    t.string   "address2"
    t.string   "address3"
    t.string   "pc"
    t.string   "city"
    t.string   "country"
    t.text     "skills"
    t.integer  "sheet_type"
    t.integer  "first_people"
    t.integer  "first_year"
    t.integer  "last_year"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.boolean  "plume"
    t.string   "token"
    t.string   "sheet_number"
  end

  create_table "survey_item_answers", :force => true do |t|
    t.text     "label_text"
    t.text     "help_text"
    t.string   "class_text"
    t.integer  "field_type"
    t.integer  "data_type"
    t.integer  "survey_item_id"
    t.boolean  "locked"
    t.boolean  "archived"
    t.datetime "created_at",     :null => false
    t.datetime "updated_at",     :null => false
  end

  add_index "survey_item_answers", ["survey_item_id"], :name => "index_survey_item_answers_on_survey_item_id"

  create_table "survey_items", :force => true do |t|
    t.integer  "item_type"
    t.text     "title"
    t.text     "description"
    t.text     "help"
    t.integer  "questions_type"
    t.integer  "display_type"
    t.integer  "survey_type_id"
    t.integer  "string_type"
    t.boolean  "locked"
    t.boolean  "archived"
    t.integer  "text_presentation"
    t.integer  "max_checkboxes"
    t.datetime "created_at",        :null => false
    t.datetime "updated_at",        :null => false
  end

  add_index "survey_items", ["survey_type_id"], :name => "index_survey_items_on_survey_type_id"

  create_table "survey_sets", :force => true do |t|
    t.integer  "survey_type_id"
    t.datetime "created_at",     :null => false
    t.datetime "updated_at",     :null => false
  end

  add_index "survey_sets", ["survey_type_id"], :name => "index_survey_sets_on_survey_type_id"

  create_table "survey_types", :force => true do |t|
    t.string   "name"
    t.string   "slug"
    t.text     "description"
    t.text     "thank_text"
    t.text     "intro_text"
    t.boolean  "locked"
    t.boolean  "archived"
    t.datetime "created_at",  :null => false
    t.datetime "updated_at",  :null => false
  end

  create_table "tiny_urls", :force => true do |t|
    t.string   "url"
    t.string   "slug"
    t.text     "description"
    t.datetime "start_at"
    t.datetime "stop_at"
    t.integer  "nbr_views"
    t.datetime "created_at",  :null => false
    t.datetime "updated_at",  :null => false
  end

  create_table "topics", :force => true do |t|
    t.string   "title"
    t.text     "description"
    t.integer  "admin_id"
    t.datetime "created_at",  :null => false
    t.datetime "updated_at",  :null => false
  end

  add_index "topics", ["admin_id"], :name => "index_topics_on_admin_id"

end