# 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 => 20111218002349) do create_table "baskets", :force => true do |t| t.integer "user_id" t.text "note" t.string "type" t.integer "lock_version", :default => 0, :null => false t.datetime "created_at" t.datetime "updated_at" end add_index "baskets", ["type"], :name => "index_baskets_on_type" add_index "baskets", ["user_id"], :name => "index_baskets_on_user_id" create_table "carrier_type_has_checkout_types", :force => true do |t| t.integer "carrier_type_id", :null => false t.integer "checkout_type_id", :null => false t.text "note" t.integer "position" t.datetime "created_at" t.datetime "updated_at" end add_index "carrier_type_has_checkout_types", ["carrier_type_id"], :name => "index_carrier_type_has_checkout_types_on_m_form_id" add_index "carrier_type_has_checkout_types", ["checkout_type_id"], :name => "index_carrier_type_has_checkout_types_on_checkout_type_id" create_table "carrier_types", :force => true do |t| t.string "name", :null => false t.text "display_name" t.text "note" t.integer "position" t.datetime "created_at" t.datetime "updated_at" end create_table "checked_items", :force => true do |t| t.integer "item_id", :null => false t.integer "basket_id", :null => false t.datetime "due_date", :null => false t.datetime "created_at" t.datetime "updated_at" end add_index "checked_items", ["basket_id"], :name => "index_checked_items_on_basket_id" add_index "checked_items", ["item_id"], :name => "index_checked_items_on_item_id" create_table "checkins", :force => true do |t| t.integer "item_id", :null => false t.integer "librarian_id" t.integer "basket_id" t.datetime "created_at" t.datetime "updated_at" end add_index "checkins", ["basket_id"], :name => "index_checkins_on_basket_id" add_index "checkins", ["item_id"], :name => "index_checkins_on_item_id" add_index "checkins", ["librarian_id"], :name => "index_checkins_on_librarian_id" create_table "checkout_stat_has_manifestations", :force => true do |t| t.integer "manifestation_checkout_stat_id", :null => false t.integer "manifestation_id", :null => false t.integer "checkouts_count" t.datetime "created_at" t.datetime "updated_at" end add_index "checkout_stat_has_manifestations", ["manifestation_checkout_stat_id"], :name => "index_checkout_stat_has_manifestations_on_checkout_stat_id" add_index "checkout_stat_has_manifestations", ["manifestation_id"], :name => "index_checkout_stat_has_manifestations_on_manifestation_id" create_table "checkout_stat_has_users", :force => true do |t| t.integer "user_checkout_stat_id", :null => false t.integer "user_id", :null => false t.integer "checkouts_count", :default => 0, :null => false t.datetime "created_at" t.datetime "updated_at" end add_index "checkout_stat_has_users", ["user_checkout_stat_id"], :name => "index_checkout_stat_has_users_on_user_checkout_stat_id" add_index "checkout_stat_has_users", ["user_id"], :name => "index_checkout_stat_has_users_on_user_id" create_table "checkout_types", :force => true do |t| t.string "name", :null => false t.text "display_name" t.text "note" t.integer "position" t.datetime "created_at" t.datetime "updated_at" end add_index "checkout_types", ["name"], :name => "index_checkout_types_on_name" create_table "checkouts", :force => true do |t| t.integer "user_id" t.integer "item_id", :null => false t.integer "checkin_id" t.integer "librarian_id" t.integer "basket_id" t.datetime "due_date" t.integer "checkout_renewal_count", :default => 0, :null => false t.integer "lock_version", :default => 0, :null => false t.datetime "created_at" t.datetime "updated_at" end add_index "checkouts", ["basket_id"], :name => "index_checkouts_on_basket_id" add_index "checkouts", ["checkin_id"], :name => "index_checkouts_on_checkin_id" add_index "checkouts", ["item_id", "basket_id"], :name => "index_checkouts_on_item_id_and_basket_id", :unique => true add_index "checkouts", ["item_id"], :name => "index_checkouts_on_item_id" add_index "checkouts", ["librarian_id"], :name => "index_checkouts_on_librarian_id" add_index "checkouts", ["user_id"], :name => "index_checkouts_on_user_id" create_table "circulation_statuses", :force => true do |t| t.string "name", :null => false t.text "display_name" t.text "note" t.integer "position" t.datetime "created_at" t.datetime "updated_at" end create_table "event_categories", :force => true do |t| t.string "name", :null => false t.text "display_name" t.text "note" t.integer "position" t.datetime "created_at" t.datetime "updated_at" end create_table "events", :force => true do |t| t.integer "library_id", :default => 1, :null => false t.integer "event_category_id", :default => 1, :null => false t.string "name" t.text "note" t.datetime "start_at" t.datetime "end_at" t.boolean "all_day", :default => false, :null => false t.datetime "deleted_at" t.text "display_name" t.datetime "created_at" t.datetime "updated_at" end add_index "events", ["event_category_id"], :name => "index_events_on_event_category_id" add_index "events", ["library_id"], :name => "index_events_on_library_id" create_table "exemplifies", :force => true do |t| t.integer "manifestation_id", :null => false t.integer "item_id", :null => false t.string "type" t.integer "position" t.datetime "created_at" t.datetime "updated_at" end add_index "exemplifies", ["item_id"], :name => "index_exemplifies_on_item_id", :unique => true add_index "exemplifies", ["manifestation_id"], :name => "index_exemplifies_on_manifestation_id" add_index "exemplifies", ["type"], :name => "index_exemplifies_on_type" create_table "item_has_use_restrictions", :force => true do |t| t.integer "item_id", :null => false t.integer "use_restriction_id", :null => false t.datetime "created_at" t.datetime "updated_at" end add_index "item_has_use_restrictions", ["item_id"], :name => "index_item_has_use_restrictions_on_item_id" add_index "item_has_use_restrictions", ["use_restriction_id"], :name => "index_item_has_use_restrictions_on_use_restriction_id" create_table "items", :force => true do |t| t.string "call_number" t.string "item_identifier" t.integer "circulation_status_id", :default => 5, :null => false t.integer "checkout_type_id", :default => 1, :null => false t.datetime "created_at" t.datetime "updated_at" t.datetime "deleted_at" t.integer "shelf_id", :default => 1, :null => false t.integer "basket_id" t.boolean "include_supplements", :default => false, :null => false t.integer "checkouts_count", :default => 0, :null => false t.integer "owns_count", :default => 0, :null => false t.integer "resource_has_subjects_count", :default => 0, :null => false t.text "note" t.string "url" t.integer "price" t.integer "lock_version", :default => 0, :null => false t.integer "required_role_id", :default => 1, :null => false t.string "state" t.integer "required_score", :default => 0, :null => false end add_index "items", ["checkout_type_id"], :name => "index_items_on_checkout_type_id" add_index "items", ["circulation_status_id"], :name => "index_items_on_circulation_status_id" add_index "items", ["item_identifier"], :name => "index_items_on_item_identifier" add_index "items", ["required_role_id"], :name => "index_items_on_required_role_id" add_index "items", ["shelf_id"], :name => "index_items_on_shelf_id" create_table "languages", :force => true do |t| t.string "name", :null => false t.string "native_name" t.text "display_name" t.string "iso_639_1" t.string "iso_639_2" t.string "iso_639_3" t.text "note" t.integer "position" end add_index "languages", ["iso_639_1"], :name => "index_languages_on_iso_639_1" add_index "languages", ["iso_639_2"], :name => "index_languages_on_iso_639_2" add_index "languages", ["iso_639_3"], :name => "index_languages_on_iso_639_3" add_index "languages", ["name"], :name => "index_languages_on_name", :unique => true create_table "lending_policies", :force => true do |t| t.integer "item_id", :null => false t.integer "user_group_id", :null => false t.integer "loan_period", :default => 0, :null => false t.datetime "fixed_due_date" t.integer "renewal", :default => 0, :null => false t.decimal "fine", :default => 0.0, :null => false t.text "note" t.integer "position" t.datetime "created_at" t.datetime "updated_at" end add_index "lending_policies", ["item_id"], :name => "index_lending_policies_on_item_id" add_index "lending_policies", ["user_group_id"], :name => "index_lending_policies_on_user_group_id" create_table "libraries", :force => true do |t| t.integer "patron_id" t.string "patron_type" t.string "name", :null => false t.text "display_name" t.string "short_display_name", :null => false t.string "zip_code" t.text "street" t.text "locality" t.text "region" t.string "telephone_number_1" t.string "telephone_number_2" t.string "fax_number" t.text "note" t.integer "call_number_rows", :default => 1, :null => false t.string "call_number_delimiter", :default => "|", :null => false t.integer "library_group_id", :default => 1, :null => false t.integer "users_count", :default => 0, :null => false t.integer "position" t.integer "country_id" t.datetime "created_at" t.datetime "updated_at" t.datetime "deleted_at" end add_index "libraries", ["library_group_id"], :name => "index_libraries_on_library_group_id" add_index "libraries", ["name"], :name => "index_libraries_on_name", :unique => true add_index "libraries", ["patron_id"], :name => "index_libraries_on_patron_id", :unique => true create_table "library_groups", :force => true do |t| t.string "name", :null => false t.text "display_name" t.string "short_name", :null => false t.string "email" t.text "my_networks" t.text "login_banner" t.text "note" t.boolean "post_to_union_catalog", :default => false, :null => false t.integer "country_id" t.datetime "created_at" t.datetime "updated_at" t.text "admin_networks" t.boolean "allow_bookmark_external_url", :default => false, :null => false t.integer "position" t.string "url", :default => "http://localhost:3000/" end add_index "library_groups", ["short_name"], :name => "index_library_groups_on_short_name" create_table "manifestation_checkout_stats", :force => true do |t| t.datetime "start_date" t.datetime "end_date" t.text "note" t.string "state" t.datetime "created_at" t.datetime "updated_at" t.datetime "started_at" t.datetime "completed_at" end add_index "manifestation_checkout_stats", ["state"], :name => "index_manifestation_checkout_stats_on_state" create_table "manifestation_reserve_stats", :force => true do |t| t.datetime "start_date" t.datetime "end_date" t.text "note" t.string "state" t.datetime "created_at" t.datetime "updated_at" t.datetime "started_at" t.datetime "completed_at" end add_index "manifestation_reserve_stats", ["state"], :name => "index_manifestation_reserve_stats_on_state" create_table "manifestations", :force => true do |t| t.text "original_title", :null => false t.text "title_alternative" t.text "title_transcription" t.string "classification_number" t.string "manifestation_identifier" t.datetime "date_of_publication" t.datetime "copyright_date" t.datetime "created_at" t.datetime "updated_at" t.datetime "deleted_at" t.string "access_address" t.integer "language_id", :default => 1, :null => false t.integer "carrier_type_id", :default => 1, :null => false t.integer "extent_id", :default => 1, :null => false t.integer "start_page" t.integer "end_page" t.decimal "height" t.decimal "width" t.decimal "depth" t.string "isbn" t.string "isbn10" t.string "wrong_isbn" t.string "nbn" t.string "lccn" t.string "oclc_number" t.string "issn" t.integer "price" t.text "fulltext" t.string "volume_number_list" t.string "issue_number_list" t.string "serial_number_list" t.integer "edition" t.text "note" t.integer "produces_count", :default => 0, :null => false t.integer "exemplifies_count", :default => 0, :null => false t.integer "embodies_count", :default => 0, :null => false t.integer "work_has_subjects_count", :default => 0, :null => false t.boolean "repository_content", :default => false, :null => false t.integer "lock_version", :default => 0, :null => false t.integer "required_role_id", :default => 1, :null => false t.string "state" t.integer "required_score", :default => 0, :null => false t.integer "frequency_id", :default => 1, :null => false t.boolean "subscription_master", :default => false, :null => false end add_index "manifestations", ["access_address"], :name => "index_manifestations_on_access_address" add_index "manifestations", ["carrier_type_id"], :name => "index_manifestations_on_carrier_type_id" add_index "manifestations", ["frequency_id"], :name => "index_manifestations_on_frequency_id" add_index "manifestations", ["isbn"], :name => "index_manifestations_on_isbn" add_index "manifestations", ["issn"], :name => "index_manifestations_on_issn" add_index "manifestations", ["lccn"], :name => "index_manifestations_on_lccn" add_index "manifestations", ["manifestation_identifier"], :name => "index_manifestations_on_manifestation_identifier" add_index "manifestations", ["nbn"], :name => "index_manifestations_on_nbn" add_index "manifestations", ["oclc_number"], :name => "index_manifestations_on_oclc_number" add_index "manifestations", ["required_role_id"], :name => "index_manifestations_on_required_role_id" add_index "manifestations", ["updated_at"], :name => "index_manifestations_on_updated_at" create_table "message_requests", :force => true do |t| t.integer "sender_id" t.integer "receiver_id" t.integer "message_template_id" t.datetime "sent_at" t.datetime "deleted_at" t.text "body" t.string "state" t.datetime "created_at" t.datetime "updated_at" end add_index "message_requests", ["state"], :name => "index_message_requests_on_state" create_table "message_templates", :force => true do |t| t.string "status", :null => false t.text "title", :null => false t.text "body", :null => false t.integer "position" t.string "locale", :default => "en" t.datetime "created_at" t.datetime "updated_at" end add_index "message_templates", ["status"], :name => "index_message_templates_on_status", :unique => true create_table "messages", :force => true do |t| t.datetime "read_at" t.integer "receiver_id" t.integer "sender_id" t.string "subject", :null => false t.text "body" t.integer "message_request_id" t.string "state" t.integer "parent_id" t.datetime "created_at" t.datetime "updated_at" t.integer "lft" t.integer "rgt" end add_index "messages", ["message_request_id"], :name => "index_messages_on_message_request_id" add_index "messages", ["parent_id"], :name => "index_messages_on_parent_id" add_index "messages", ["receiver_id"], :name => "index_messages_on_receiver_id" add_index "messages", ["sender_id"], :name => "index_messages_on_sender_id" create_table "patron_types", :force => true do |t| t.string "name", :null => false t.text "display_name" t.text "note" t.integer "position" t.datetime "created_at" t.datetime "updated_at" end create_table "patrons", :force => true do |t| t.integer "user_id" t.string "last_name" t.string "middle_name" t.string "first_name" t.string "last_name_transcription" t.string "middle_name_transcription" t.string "first_name_transcription" t.string "corporate_name" t.string "corporate_name_transcription" t.string "full_name" t.text "full_name_transcription" t.text "full_name_alternative" t.datetime "created_at" t.datetime "updated_at" t.datetime "deleted_at" t.string "zip_code_1" t.string "zip_code_2" t.text "address_1" t.text "address_2" t.text "address_1_note" t.text "address_2_note" t.string "telephone_number_1" t.string "telephone_number_2" t.string "fax_number_1" t.string "fax_number_2" t.text "other_designation" t.text "place" t.string "postal_code" t.text "street" t.text "locality" t.text "region" t.datetime "date_of_birth" t.datetime "date_of_death" t.integer "language_id", :default => 1, :null => false t.integer "country_id", :default => 1, :null => false t.integer "patron_type_id", :default => 1, :null => false t.integer "lock_version", :default => 0, :null => false t.text "note" t.integer "creates_count", :default => 0, :null => false t.integer "realizes_count", :default => 0, :null => false t.integer "produces_count", :default => 0, :null => false t.integer "owns_count", :default => 0, :null => false t.integer "required_role_id", :default => 1, :null => false t.integer "required_score", :default => 0, :null => false t.string "state" t.text "email" t.text "url" end add_index "patrons", ["country_id"], :name => "index_patrons_on_country_id" add_index "patrons", ["full_name"], :name => "index_patrons_on_full_name" add_index "patrons", ["language_id"], :name => "index_patrons_on_language_id" add_index "patrons", ["required_role_id"], :name => "index_patrons_on_required_role_id" add_index "patrons", ["user_id"], :name => "index_patrons_on_user_id", :unique => true create_table "request_status_types", :force => true do |t| t.string "name", :null => false t.text "display_name" t.text "note" t.integer "position" t.datetime "created_at" t.datetime "updated_at" end create_table "request_types", :force => true do |t| t.string "name", :null => false t.text "display_name" t.text "note" t.integer "position" t.datetime "created_at" t.datetime "updated_at" end create_table "reserve_stat_has_manifestations", :force => true do |t| t.integer "manifestation_reserve_stat_id", :null => false t.integer "manifestation_id", :null => false t.integer "reserves_count" t.datetime "created_at" t.datetime "updated_at" end add_index "reserve_stat_has_manifestations", ["manifestation_id"], :name => "index_reserve_stat_has_manifestations_on_manifestation_id" add_index "reserve_stat_has_manifestations", ["manifestation_reserve_stat_id"], :name => "index_reserve_stat_has_manifestations_on_m_reserve_stat_id" create_table "reserve_stat_has_users", :force => true do |t| t.integer "user_reserve_stat_id", :null => false t.integer "user_id", :null => false t.integer "reserves_count" t.datetime "created_at" t.datetime "updated_at" end add_index "reserve_stat_has_users", ["user_id"], :name => "index_reserve_stat_has_users_on_user_id" add_index "reserve_stat_has_users", ["user_reserve_stat_id"], :name => "index_reserve_stat_has_users_on_user_reserve_stat_id" create_table "reserves", :force => true do |t| t.integer "user_id", :null => false t.integer "manifestation_id", :null => false t.integer "item_id" t.integer "request_status_type_id", :null => false t.datetime "checked_out_at" t.datetime "created_at" t.datetime "updated_at" t.datetime "canceled_at" t.datetime "expired_at" t.datetime "deleted_at" t.string "state" t.boolean "expiration_notice_to_patron", :default => false t.boolean "expiration_notice_to_library", :default => false end add_index "reserves", ["item_id"], :name => "index_reserves_on_item_id" add_index "reserves", ["manifestation_id"], :name => "index_reserves_on_manifestation_id" add_index "reserves", ["request_status_type_id"], :name => "index_reserves_on_request_status_type_id" add_index "reserves", ["user_id"], :name => "index_reserves_on_user_id" create_table "roles", :force => true do |t| t.string "name" t.text "display_name" t.text "note" t.integer "position" t.datetime "created_at" t.datetime "updated_at" end create_table "shelves", :force => true do |t| t.string "name", :null => false t.text "display_name" t.text "note" t.integer "library_id", :default => 1, :null => false t.integer "items_count", :default => 0, :null => false t.integer "position" t.datetime "created_at" t.datetime "updated_at" t.datetime "deleted_at" end add_index "shelves", ["library_id"], :name => "index_shelves_on_library_id" create_table "use_restrictions", :force => true do |t| t.string "name", :null => false t.text "display_name" t.text "note" t.integer "position" t.datetime "created_at" t.datetime "updated_at" end create_table "user_checkout_stats", :force => true do |t| t.datetime "start_date" t.datetime "end_date" t.text "note" t.string "state" t.datetime "created_at" t.datetime "updated_at" t.datetime "started_at" t.datetime "completed_at" end add_index "user_checkout_stats", ["state"], :name => "index_user_checkout_stats_on_state" create_table "user_group_has_checkout_types", :force => true do |t| t.integer "user_group_id", :null => false t.integer "checkout_type_id", :null => false t.integer "checkout_limit", :default => 0, :null => false t.integer "checkout_period", :default => 0, :null => false t.integer "checkout_renewal_limit", :default => 0, :null => false t.integer "reservation_limit", :default => 0, :null => false t.integer "reservation_expired_period", :default => 7, :null => false t.boolean "set_due_date_before_closing_day", :default => false, :null => false t.datetime "fixed_due_date" t.text "note" t.integer "position" t.datetime "created_at" t.datetime "updated_at" t.integer "current_checkout_count" end add_index "user_group_has_checkout_types", ["checkout_type_id"], :name => "index_user_group_has_checkout_types_on_checkout_type_id" add_index "user_group_has_checkout_types", ["user_group_id"], :name => "index_user_group_has_checkout_types_on_user_group_id" create_table "user_groups", :force => true do |t| t.string "name" t.string "string" t.text "display_name" t.text "note" t.integer "position" t.datetime "created_at" t.datetime "updated_at" t.datetime "deleted_at" t.integer "valid_period_for_new_user", :default => 0, :null => false t.datetime "expired_at" t.integer "number_of_day_to_notify_overdue", :default => 1, :null => false t.integer "number_of_day_to_notify_due_date", :default => 7, :null => false t.integer "number_of_time_to_notify_overdue", :default => 3, :null => false end create_table "user_has_roles", :force => true do |t| t.integer "user_id" t.integer "role_id" t.datetime "created_at" t.datetime "updated_at" end create_table "user_reserve_stats", :force => true do |t| t.datetime "start_date" t.datetime "end_date" t.text "note" t.string "state" t.datetime "created_at" t.datetime "updated_at" t.datetime "started_at" t.datetime "completed_at" end add_index "user_reserve_stats", ["state"], :name => "index_user_reserve_stats_on_state" create_table "users", :force => true do |t| t.integer "user_group_id" t.integer "required_role_id" t.string "username" t.text "note" t.string "locale" t.string "user_number" t.integer "library_id" t.datetime "created_at" t.datetime "updated_at" t.string "email", :default => "", :null => false t.string "encrypted_password", :limit => 128, :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 "save_checkout_history" t.string "checkout_icalendar_token" end add_index "users", ["email"], :name => "index_users_on_email" add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true end