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

  create_table "contractor_initializations", force: :cascade do |t|
    t.integer "workflow_instance_id"
    t.string "state"
    t.string "sti_type"
    t.text "notes"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.index ["workflow_instance_id"], name: "index_contractor_initializations_on_workflow_instance_id"
  end

  create_table "dunlop_file_downloads", force: :cascade do |t|
    t.integer "user_id"
    t.string "file_type"
    t.integer "file_id"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.index ["file_type", "file_id"], name: "index_dunlop_file_downloads_on_file_type_and_file_id"
    t.index ["user_id"], name: "index_dunlop_file_downloads_on_user_id"
  end

  create_table "dunlop_last_attribute_changes", force: :cascade do |t|
    t.integer "target_id"
    t.string "target_type"
    t.datetime "changed_at"
    t.string "attribute_name"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  create_table "dunlop_log_entries", force: :cascade do |t|
    t.integer "loggable_id"
    t.string "loggable_type"
    t.text "body"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.text "backtrace"
    t.index ["loggable_id", "loggable_type"], name: "index_dunlop_log_entries_on_loggable_id_and_loggable_type"
  end

  create_table "execution_batches", force: :cascade do |t|
    t.string "state"
    t.string "sti_type"
    t.string "identifier"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.string "info_message"
  end

  create_table "non_workflow_projects", force: :cascade do |t|
    t.string "name"
    t.string "identifier"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.integer "working_week"
    t.integer "working_year"
    t.date "working_date"
    t.integer "epoch_week"
  end

  create_table "owner_initializations", force: :cascade do |t|
    t.integer "workflow_instance_id"
    t.string "state"
    t.string "sti_type"
    t.text "notes"
    t.boolean "initialization_check_done", default: false, null: false
    t.date "plan_date"
    t.string "my_identifier"
    t.integer "window_from"
    t.integer "window_to"
    t.integer "number_of_visits"
    t.float "my_fraction"
    t.text "my_explanation"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.index ["workflow_instance_id"], name: "index_owner_initializations_on_workflow_instance_id"
  end

  create_table "source_files", force: :cascade do |t|
    t.string "sti_type"
    t.string "state"
    t.string "description"
    t.integer "number_of_records"
    t.integer "duration"
    t.string "original_file"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.date "current_at_day"
    t.integer "creator_id"
    t.string "creator_type"
  end

  create_table "source_record_my_sources", force: :cascade do |t|
    t.date "my_date"
    t.string "my_var"
    t.integer "my_count"
    t.float "my_num"
    t.boolean "my_truth"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  create_table "target_files", force: :cascade do |t|
    t.string "sti_type"
    t.string "state"
    t.integer "size"
    t.integer "number_of_records"
    t.datetime "start_time"
    t.datetime "end_time"
    t.string "original_file"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  create_table "users", force: :cascade 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, null: false
    t.datetime "current_sign_in_at"
    t.datetime "last_sign_in_at"
    t.string "current_sign_in_ip"
    t.string "last_sign_in_ip"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.boolean "admin", default: false, null: false
    t.text "role_names"
    t.text "settings_storage"
    t.text "role_names_admin"
    t.string "authentication_token"
    t.datetime "authentication_token_created_at"
    t.index ["authentication_token"], name: "index_users_on_authentication_token"
    t.index ["email"], name: "index_users_on_email", unique: true
    t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
  end

  create_table "wba_submissions", force: :cascade do |t|
    t.integer "workflow_instance_id"
    t.string "state"
    t.string "sti_type"
    t.text "notes"
    t.boolean "all_clear", default: false, null: false
    t.string "new_service_group"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.index ["workflow_instance_id"], name: "index_wba_submissions_on_workflow_instance_id"
  end

  create_table "workflow_instance_batches", force: :cascade do |t|
    t.string "sti_type"
    t.string "state"
    t.string "name"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.date "plan_date"
  end

  create_table "workflow_instances", force: :cascade do |t|
    t.string "sti_type"
    t.string "state"
    t.datetime "archived_at"
    t.string "bucket"
    t.integer "workflow_instance_batch_id"
    t.date "plan_date"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.string "zipcode"
    t.integer "housenumber"
    t.string "housenumber_ext"
    t.string "my_name"
  end

end
