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

  add_extension "hstore"

  create_table "audio_files", :force => true do |t|
    t.integer  "item_id"
    t.string   "file"
    t.datetime "created_at",                     :null => false
    t.datetime "updated_at",                     :null => false
    t.string   "original_file_url"
    t.string   "identifier"
    t.integer  "instance_id"
    t.text     "transcript"
    t.string   "format"
    t.integer  "size",              :limit => 8
    t.integer  "storage_id"
    t.string   "path"
    t.time     "deleted_at"
    t.datetime "transcoded_at"
    t.integer  "duration"
    t.boolean  "metered"
  end

  add_index "audio_files", ["item_id", "deleted_at"], :name => "index_audio_files_on_item_id_and_deleted_at"
  add_index "audio_files", ["item_id"], :name => "index_audio_files_on_item_id"

  create_table "collection_grants", :force => true do |t|
    t.integer  "collection_id"
    t.integer  "collector_id"
    t.datetime "created_at",                            :null => false
    t.datetime "updated_at",                            :null => false
    t.boolean  "uploads_collection", :default => false
    t.string   "collector_type"
  end

  add_index "collection_grants", ["collection_id"], :name => "index_collection_grants_on_collection_id"
  add_index "collection_grants", ["collector_id", "collection_id"], :name => "index_collection_grants_on_user_id_and_collection_id", :unique => true
  add_index "collection_grants", ["collector_id"], :name => "index_collection_grants_on_user_id"

  create_table "collections", :force => true do |t|
    t.string   "title"
    t.text     "description"
    t.datetime "created_at",                                  :null => false
    t.datetime "updated_at",                                  :null => false
    t.boolean  "items_visible_by_default", :default => false
    t.boolean  "copy_media"
    t.integer  "default_storage_id"
    t.integer  "upload_storage_id"
    t.datetime "deleted_at"
    t.integer  "creator_id"
  end

  create_table "contributions", :force => true do |t|
    t.integer  "person_id"
    t.integer  "item_id"
    t.string   "role"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
  end

  add_index "contributions", ["item_id"], :name => "index_contributions_on_item_id"
  add_index "contributions", ["person_id"], :name => "index_contributions_on_person_id"
  add_index "contributions", ["role", "item_id"], :name => "index_contributions_on_role_and_item_id"

  create_table "csv_imports", :force => true do |t|
    t.datetime "created_at",                   :null => false
    t.datetime "updated_at",                   :null => false
    t.string   "file"
    t.integer  "state_index",   :default => 0
    t.string   "headers",                                      :array => true
    t.string   "file_name"
    t.integer  "collection_id", :default => 0
    t.string   "error_message"
    t.text     "backtrace"
    t.integer  "user_id"
  end

  add_index "csv_imports", ["user_id"], :name => "index_csv_imports_on_user_id"

  create_table "csv_rows", :force => true do |t|
    t.text     "values",                        :array => true
    t.integer  "csv_import_id"
    t.datetime "created_at",    :null => false
    t.datetime "updated_at",    :null => false
  end

  add_index "csv_rows", ["csv_import_id"], :name => "index_csv_rows_on_csv_import_id"

  create_table "entities", :force => true do |t|
    t.boolean  "is_confirmed"
    t.string   "identifier"
    t.string   "name"
    t.float    "score"
    t.string   "category"
    t.string   "entity_type"
    t.integer  "item_id"
    t.text     "extra"
    t.datetime "created_at",   :null => false
    t.datetime "updated_at",   :null => false
  end

  add_index "entities", ["is_confirmed", "item_id", "score"], :name => "index_entities_on_is_confirmed_and_item_id_and_score"
  add_index "entities", ["item_id"], :name => "index_entities_on_item_id"

  create_table "geolocations", :force => true do |t|
    t.string   "name"
    t.string   "slug"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
    t.decimal  "latitude"
    t.decimal  "longitude"
  end

  create_table "import_mappings", :force => true do |t|
    t.string   "data_type"
    t.string   "column"
    t.integer  "csv_import_id"
    t.datetime "created_at",    :null => false
    t.datetime "updated_at",    :null => false
    t.integer  "position"
  end

  add_index "import_mappings", ["csv_import_id"], :name => "index_import_mappings_on_csv_import_id"

  create_table "instances", :force => true do |t|
    t.string   "identifier"
    t.boolean  "digital"
    t.string   "location"
    t.string   "format"
    t.integer  "item_id"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
  end

  create_table "items", :force => true do |t|
    t.string   "title"
    t.string   "episode_title"
    t.string   "series_title"
    t.text     "description"
    t.string   "identifier"
    t.date     "date_broadcast"
    t.date     "date_created"
    t.string   "rights"
    t.string   "physical_format"
    t.string   "digital_format"
    t.string   "physical_location"
    t.string   "digital_location"
    t.integer  "duration"
    t.string   "music_sound_used"
    t.string   "date_peg"
    t.text     "notes"
    t.text     "transcription"
    t.string   "tags",                              :array => true
    t.integer  "geolocation_id"
    t.hstore   "extra"
    t.datetime "created_at",        :null => false
    t.datetime "updated_at",        :null => false
    t.integer  "csv_import_id"
    t.integer  "collection_id"
    t.string   "token"
    t.integer  "storage_id"
    t.boolean  "is_public"
    t.string   "language"
    t.datetime "deleted_at"
  end

  add_index "items", ["collection_id"], :name => "index_items_on_collection_id"
  add_index "items", ["csv_import_id"], :name => "index_items_on_csv_import_id"
  add_index "items", ["geolocation_id"], :name => "index_items_on_geolocation_id"

  create_table "oauth_access_grants", :force => true do |t|
    t.integer  "resource_owner_id", :null => false
    t.integer  "application_id",    :null => false
    t.string   "token",             :null => false
    t.integer  "expires_in",        :null => false
    t.string   "redirect_uri",      :null => false
    t.datetime "created_at",        :null => false
    t.datetime "revoked_at"
    t.string   "scopes"
  end

  add_index "oauth_access_grants", ["token"], :name => "index_oauth_access_grants_on_token", :unique => true<commit_msg>fix schema for last round of migrations<commit_after># 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 => 20130930203222) do

  add_extension "hstore"

  create_table "audio_files", :force => true do |t|
    t.integer  "item_id"
    t.string   "file"
    t.datetime "created_at",                     :null => false
    t.datetime "updated_at",                     :null => false
    t.string   "original_file_url"
    t.string   "identifier"
    t.integer  "instance_id"
    t.text     "transcript"
    t.string   "format"
    t.integer  "size",              :limit => 8
    t.integer  "storage_id"
    t.string   "path"
    t.time     "deleted_at"
    t.datetime "transcoded_at"
    t.integer  "duration"
    t.boolean  "metered"
  end

  add_index "audio_files", ["item_id"], :name => "index_audio_files_on_item_id"

  create_table "collection_grants", :force => true do |t|
    t.integer  "collection_id"
    t.integer  "collector_id"
    t.datetime "created_at",                            :null => false
    t.datetime "updated_at",                            :null => false
    t.boolean  "uploads_collection", :default => false
    t.string   "collector_type"
  end

  add_index "collection_grants", ["collection_id"], :name => "index_collection_grants_on_collection_id"
  add_index "collection_grants", ["collector_id", "collection_id"], :name => "index_collection_grants_on_user_id_and_collection_id", :unique => true
  add_index "collection_grants", ["collector_id"], :name => "index_collection_grants_on_user_id"

  create_table "collections", :force => true do |t|
    t.string   "title"
    t.text     "description"
    t.datetime "created_at",                                  :null => false
    t.datetime "updated_at",                                  :null => false
    t.boolean  "items_visible_by_default", :default => false
    t.boolean  "copy_media"
    t.integer  "default_storage_id"
    t.integer  "upload_storage_id"
    t.datetime "deleted_at"
    t.integer  "creator_id"
  end

  create_table "contributions", :force => true do |t|
    t.integer  "person_id"
    t.integer  "item_id"
    t.string   "role"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
  end

  add_index "contributions", ["item_id"], :name => "index_contributions_on_item_id"
  add_index "contributions", ["person_id"], :name => "index_contributions_on_person_id"
  add_index "contributions", ["role", "item_id"], :name => "index_contributions_on_role_and_item_id"

  create_table "csv_imports", :force => true do |t|
    t.datetime "created_at",                   :null => false
    t.datetime "updated_at",                   :null => false
    t.string   "file"
    t.integer  "state_index",   :default => 0
    t.string   "headers",                                      :array => true
    t.string   "file_name"
    t.integer  "collection_id", :default => 0
    t.string   "error_message"
    t.text     "backtrace"
    t.integer  "user_id"
  end

  add_index "csv_imports", ["user_id"], :name => "index_csv_imports_on_user_id"

  create_table "csv_rows", :force => true do |t|
    t.text     "values",                        :array => true
    t.integer  "csv_import_id"
    t.datetime "created_at",    :null => false
    t.datetime "updated_at",    :null => false
  end

  add_index "csv_rows", ["csv_import_id"], :name => "index_csv_rows_on_csv_import_id"

  create_table "entities", :force => true do |t|
    t.boolean  "is_confirmed"
    t.string   "identifier"
    t.string   "name"
    t.float    "score"
    t.string   "category"
    t.string   "entity_type"
    t.integer  "item_id"
    t.text     "extra"
    t.datetime "created_at",   :null => false
    t.datetime "updated_at",   :null => false
  end

  add_index "entities", ["is_confirmed", "item_id", "score"], :name => "index_entities_on_is_confirmed_and_item_id_and_score"
  add_index "entities", ["item_id"], :name => "index_entities_on_item_id"

  create_table "geolocations", :force => true do |t|
    t.string   "name"
    t.string   "slug"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
    t.decimal  "latitude"
    t.decimal  "longitude"
  end

  create_table "import_mappings", :force => true do |t|
    t.string   "data_type"
    t.string   "column"
    t.integer  "csv_import_id"
    t.datetime "created_at",    :null => false
    t.datetime "updated_at",    :null => false
    t.integer  "position"
  end

  add_index "import_mappings", ["csv_import_id"], :name => "index_import_mappings_on_csv_import_id"

  create_table "instances", :force => true do |t|
    t.string   "identifier"
    t.boolean  "digital"
    t.string   "location"
    t.string   "format"
    t.integer  "item_id"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
  end

  create_table "items", :force => true do |t|
    t.string   "title"
    t.string   "episode_title"
    t.string   "series_title"
    t.text     "description"
    t.string   "identifier"
    t.date     "date_broadcast"
    t.date     "date_created"
    t.string   "rights"
    t.string   "physical_format"
    t.string   "digital_format"
    t.string   "physical_location"
    t.string   "digital_location"
    t.integer  "duration"
    t.string   "music_sound_used"
    t.string   "date_peg"
    t.text     "notes"
    t.string   "tags",                              :array => true
    t.integer  "geolocation_id"
    t.hstore   "extra"
    t.datetime "created_at",        :null => false
    t.datetime "updated_at",        :null => false
    t.integer  "csv_import_id"
    t.integer  "collection_id"
    t.string   "token"
    t.integer  "storage_id"
    t.boolean  "is_public"
    t.text     "transcription"
    t.string   "language"
    t.datetime "deleted_at"
  end

  add_index "items", ["collection_id"], :name => "index_items_on_collection_id"
  add_index "items", ["csv_import_id"], :name => "index_items_on_csv_import_id"
  add_index "items", ["geolocation_id"], :name => "index_items_on_geolocation_id"

  create_table "oauth_access_grants", :force => true do |t|
    t.integer  "resource_owner_id", :null => false
    t.integer  "application_id",    :null => false
    t.string   "token",             :null => false
    t.integer  "expires_in",        :null => false
    t.string   "redirect_uri",      :null => false
    t.datetime "created_at",        :null => false
    t.datetime "revoked_at"
    t.string   "scopes"
  end

  add_index "oauth_access_grants", ["token"], :name => "index_oauth_access_grants_on_token", :unique => true
{'fraction_non_alphanumeric': 0.11890347595401674, 'fraction_numerical': 0.0024488130059179647, 'mean_word_length': 2.854745673833246, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 138, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4458063', 'n_tokens_mistral': 4961, 'n_tokens_neox': 4843, 'n_words': 1195}