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

  create_table "activities", :force => true do |t|
    t.integer  "activity_verb_id"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "ancestry"
    t.integer  "author_id"
    t.integer  "user_author_id"
    t.integer  "owner_id"
  end

  add_index "activities", ["activity_verb_id"], :name => "index_activities_on_activity_verb_id"

  create_table "activity_actions", :force => true do |t|
    t.integer  "actor_id"
    t.integer  "activity_object_id"
    t.datetime "created_at",                            :null => false
    t.datetime "updated_at",                            :null => false
    t.boolean  "follow",             :default => false
    t.boolean  "author",             :default => false
    t.boolean  "user_author",        :default => false
    t.boolean  "owner",              :default => false
  end

  add_index "activity_actions", ["activity_object_id"], :name => "index_activity_actions_on_activity_object_id"
  add_index "activity_actions", ["actor_id"], :name => "index_activity_actions_on_actor_id"

  create_table "activity_object_activities", :force => true do |t|
    t.integer  "activity_id"
    t.integer  "activity_object_id"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "object_type"
  end

  add_index "activity_object_activities", ["activity_id"], :name => "index_activity_object_activities_on_activity_id"
  add_index "activity_object_activities", ["activity_object_id"], :name => "index_activity_object_activities_on_activity_object_id"

  create_table "activity_object_audiences", :force => true do |t|
    t.integer  "activity_object_id"
    t.integer  "relation_id"
    t.datetime "created_at",         :null => false
    t.datetime "updated_at",         :null => false
  end

  create_table "activity_object_properties", :force => true do |t|
    t.integer "activity_object_id"
    t.integer "property_id"
    t.string  "type"
    t.boolean "main"
  end

  add_index "activity_object_properties", ["activity_object_id"], :name => "index_activity_object_properties_on_activity_object_id"
  add_index "activity_object_properties", ["property_id"], :name => "index_activity_object_properties_on_property_id"

  create_table "activity_objects", :force => true do |t|
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "object_type",                 :limit => 45
    t.integer  "like_count",                                                               :default => 0
    t.string   "title",                                                                    :default => ""
    t.text     "description"
    t.integer  "follower_count",                                                           :default => 0
    t.integer  "visit_count",                                                              :default => 0
    t.string   "language"
    t.integer  "age_min",                                                                  :default => 0
    t.integer  "age_max",                                                                  :default => 0
    t.boolean  "notified_after_draft",                                                     :default => false
    t.integer  "comment_count",                                                            :default => 0
    t.integer  "popularity",                                                               :default => 0
    t.integer  "download_count",                                                           :default => 0
    t.integer  "qscore",                                                                   :default => 500000
    t.decimal  "reviewers_qscore",                          :precision => 12, :scale => 6
    t.decimal  "users_qscore",                              :precision => 12, :scale => 6
    t.integer  "ranking",                                                                  :default => 0
    t.integer  "title_length",                                                             :default => 1
    t.integer  "desc_length",                                                              :default => 1
    t.integer  "tags_length",                                                              :default => 1
    t.integer  "scope",                                                                    :default => 0
    t.string   "avatar_file_name"
    t.string   "avatar_content_type"
    t.integer  "avatar_file_size"
    t.datetime "avatar_updated_at"
    t.decimal  "teachers_qscore",                           :precision => 12, :scale => 6
    t.integer  "license_id"
    t.text     "original_author"
    t.text     "license_attribution"
    t.text     "license_custom"
    t.decimal  "metadata_qscore",                           :precision => 12, :scale => 6
    t.boolean  "allow_download",                                                           :default => true
    t.boolean  "allow_comment",                                                            :default => true
    t.boolean  "allow_clone",                                                              :default => true
    t.text     "tag_array_text",                                                           :default => ""
    t.decimal  "interaction_qscore",                        :precision => 12, :scale => 6
    t.decimal  "reviewers_qscore_loriam",                   :precision => 12, :scale => 6
    t.integer  "reviewers_qscore_loriam_int"
    t.boolean  "harvested",                                                                :default => false
  end

  create_table "activity_objects_wa_resources_galleries", :id => false, :force => true do |t|
    t.integer "activity_object_id"
    t.integer "wa_resources_gallery_id"
  end

  create_table "activity_verbs", :force => true do |t|
    t.string   "name",       :limit => 45
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "actor_historial", :force => true do |t|
    t.integer "actor_id"
    t.integer "activity_object_id"
  end

  create_table "actor_keys", :force => true do |t|
    t.integer  "actor_id"
    t.binary   "key_der"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
  end

  add_index "actor_keys", ["actor_id"], :name => "index_actor_keys_on_actor_id"

  create_table "actors", :force => true do |t|
    t.string   "name"
    t.string   "email",                 :default => "",        :null => false
    t.string   "slug"
    t.string   "subject_type"
    t.boolean  "notify_by_email",       :default => true
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "activity_object_id"
    t.string   "logo_file_name"
    t.string   "logo_content_type"
    t.integer  "logo_file_size"
    t.datetime "logo_updated_at"
    t.string   "notification_settings"
    t.text     "category_order"
    t.string   "categories_view",       :default => "gallery"
  end

  add_index "actors", ["activity_object_id"], :name => "index_actors_on_activity_object_id"
  add_index "actors", ["email"], :name => "index_actors_on_email"
  add_index "actors", ["slug"], :name => "index_actors_on_slug", :unique => true

  create_table "actors_roles", :id => false, :force => true do |t|
    t.integer "role_id"
    t.integer "actor_id"
  end

  create_table "audiences", :force => true do |t|
    t.integer "relation_id"
    t.integer "activity_id"
  end

  add_index "audiences", ["activity_id"], :name => "index_audiences_on_activity_id"
  add_index "audiences", ["relation_id"], :name => "index_audiences_on_relation_id"

  create_table "authentications", :force => true do |t|
    t.integer  "user_id"
    t.string   "provider"
    t.string   "uid"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
  end

  add_index "authentications", ["user_id"], :name => "index_authentications_on_user_id"

  create_table "categories", :force => true do |t|
    t.integer  "activity_object_id"
    t.datetime "created_at",         :null => false
    t.datetime "updated_at",         :null => false
    t.text     "category_order"
    t.integer  "parent_id"
  end

  create_table "comments", :force => true do |t|
    t.integer  "activity_object_id"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "comments", ["activity_object_id"], :name => "index_comments_on_activity_object_id"

  create_table "contacts", :force => true do |t|
    t.integer  "sender_id"
    t.integer  "receiver_id"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "inverse_id"
    t.integer  "ties_count",  :default => 0
  end

  add_index "contacts", ["inverse_id"], :name => "index_contacts_on_inverse_id"
  add_index "contacts", ["receiver_id"], :name => "index_contacts_on_receiver_id"
  add_index "contacts", ["sender_id"], :name => "index_contacts_on_sender_id"

  create_table "contest_categories", :force => true do |t|
    t.integer  "contest_id"
    t.string   "name"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "contest_enrollments", :force => true do |t|
    t.integer  "contest_id"
    t.integer  "actor_id"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.text     "settings",   :default => "{}"
  end

  create_table "contest_submissions", :force => true do |t|
    t.integer  "contest_category_id"
    t.integer  "activity_object_id"
    t.integer  "actor_id"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "contests", :force => true do |t|
    t.string   "name"
    t.string   "template"
    t.string   "status",       :default => "open"
    t.text     "settings",     :default => "{}"
    t.boolean  "show_in_ui",   :default => false
    t.integer  "mail_list_id"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "contributions", :force => true do |t|
    t.integer  "activity_object_id"
    t.integer  "wa_assignment_id"
    t.integer  "parent_id"
    t.datetime "created_at",         :null => false
    t.datetime "updated_at",         :null => false
  end

  create_table "conversations", :force => true do |t|
    t.string   "subject",    :default => ""
    t.datetime "created_at",                 :null => false
    t.datetime "updated_at",                 :null => false
  end

  create_table "courses", :force => true do |t|
    t.integer  "activity_object_id"
    t.datetime "created_at",                                 :null => false
    t.datetime "updated_at",                                 :null => false
    t.date     "start_date"
    t.date     "end_date"
    t.boolean  "closed",                  :default => false
    t.boolean  "restricted",              :default => false
    t.string   "restriction_email"
    t.string   "restriction_password"
    t.string   "moodle_url"
    t.string   "course_password"
    t.string   "attachment_file_name"
    t.string   "attachment_content_type"
    t.integer  "attachment_file_size"
    t.datetime "attachment_updated_at"
    t.boolean  "accredited",              :default => false
    t.text     "accredited_text"
    t.text     "accredited_logo"
    t.boolean  "self_learning_format",    :default => false
    t.text     "duration_text"
    t.text     "restriction_email_list"
  end

  create_table "courses_users", :id => false, :force => true do |t|
    t.integer "user_id"
    t.integer "course_id"
  end

  create_table "documents", :force => true do |t|
    t.string   "type"
    t.integer  "activity_object_id"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "file_file_name"
    t.string   "file_content_type"
    t.string   "file_file_size"
    t.boolean  "file_processing"
  end

  add_index "documents", ["activity_object_id"], :name => "index_documents_on_activity_object_id"

  create_table "ediphy_document_contributors", :force => true do |t|
    t.integer "ediphy_document_id"
    t.integer "contributor_id"
  end

  create_table "ediphy_documents", :force => true do |t|
    t.integer  "activity_object_id"
    t.text     "json"
    t.boolean  "draft",              :default => true
    t.datetime "created_at",                           :null => false
    t.datetime "updated_at",                           :null => false
  end

  create_table "embeds", :force => true do |t|
    t.integer  "activity_object_id"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.text     "fulltext"
    t.integer  "width",              :default => 470
    t.integer  "height",             :default => 353
    t.boolean  "live",               :default => false
  end

  create_table "events", :force => true do |t|
    t.integer  "activity_object_id"
    t.datetime "start_at"
    t.datetime "end_at"
    t.boolean  "all_day"
    t.datetime "created_at",                            :null => false
    t.datetime "updated_at",                            :null => false
    t.integer  "room_id"
    t.date     "start_date"
    t.date     "end_date"
    t.integer  "frequency",          :default => 0
    t.integer  "interval"
    t.integer  "days",               :default => 0
    t.integer  "interval_flag",      :default => 0
    t.boolean  "streaming",          :default => false
    t.text     "embed"
  end

  add_index "events", ["room_id"], :name => "index_events_on_room_id"

  create_table "excursion_contributors", :force => true do |t|
    t.integer "excursion_id"
    t.integer "contributor_id"
  end

  create_table "excursions", :force => true do |t|
    t.datetime "created_at",                                 :null => false
    t.datetime "updated_at",                                 :null => false
    t.integer  "activity_object_id"
    t.text     "json"
    t.integer  "slide_count",             :default => 1
    t.text     "thumbnail_url"
    t.boolean  "draft",                   :default => false
    t.text     "offline_manifest",        :default => ""
    t.datetime "scorm2004_timestamp"
    t.datetime "pdf_timestamp"
    t.string   "attachment_file_name"
    t.string   "attachment_content_type"
    t.integer  "attachment_file_size"
    t.datetime "attachment_updated_at"
    t.boolean  "notified_teacher",        :default => false
    t.datetime "scorm12_timestamp"
  end

  create_table "groups", :force => true do |t|
    t.integer  "actor_id"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "groups", ["actor_id"], :name => "index_groups_on_actor_id"

  create_table "imscpfiles", :force => true do |t|
    t.integer  "activity_object_id"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.text     "zipurl"
    t.text     "lourl"
    t.text     "zippath"
    t.text     "lopath"
    t.integer  "width",              :default => 800
    t.integer  "height",             :default => 600
    t.string   "file_file_name"
    t.string   "file_content_type"
    t.integer  "file_file_size"
    t.datetime "file_updated_at"
    t.string   "schema"
    t.string   "schemaversion"
    t.string   "imscp_version"
    t.string   "lohref"
    t.text     "lohrefs"
    t.string   "loresourceurl"
  end

  create_table "licenses", :force => true do |t|
    t.string   "key"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
  end

  create_table "links", :force => true do |t|
    t.integer  "activity_object_id"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.text     "url"
    t.string   "callback_url"
    t.string   "image"
    t.integer  "width",              :default => 470
    t.integer  "height",             :default => 353
    t.boolean  "is_embed",           :default => false
  end

  add_index "links", ["activity_object_id"], :name => "index_links_on_activity_object_id"

  create_table "lo_interactions", :force => true do |t|
    t.integer  "activity_object_id"
    t.datetime "created_at",         :null => false
    t.datetime "updated_at",         :null => false
    t.integer  "nsamples"
    t.integer  "nvalidsamples"
    t.integer  "tlo"
    t.integer  "tloslide"
    t.integer  "tloslide_min"
    t.integer  "tloslide_max"
    t.integer  "viewedslidesrate"
    t.integer  "nvisits"
    t.integer  "nclicks"
    t.integer  "nkeys"
    t.integer  "naq"
    t.integer  "nsq"
    t.integer  "neq"
    t.integer  "acceptancerate"
    t.integer  "repeatrate"
    t.integer  "favrate"
  end

  create_table "mail_list_items", :force => true do |t|
    t.integer  "mail_list_id"
    t.integer  "actor_id"
    t.string   "email"
    t.string   "name"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "mail_lists", :force => true do |t|
    t.string   "name"
    t.text     "settings",   :default => "{}"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "notifications", :force => true do |t|
    t.string   "type"
    t.text     "body"
    t.string   "subject",              :default => ""
    t.integer  "sender_id"
    t.string   "sender_type"
    t.integer  "conversation_id"
    t.boolean  "draft",                :default => false
    t.datetime "updated_at",                              :null => false
    t.datetime "created_at",                              :null => false
    t.integer  "notified_object_id"
    t.string   "notified_object_type"
    t.string   "notification_code"
    t.string   "attachment"
    t.boolean  "global",               :default => false
    t.datetime "expires"
  end

  add_index "notifications", ["conversation_id"], :name => "index_notifications_on_conversation_id"

  create_table "pdfexes", :force => true do |t|
    t.datetime "created_at",                             :null => false
    t.datetime "updated_at",                             :null => false
    t.string   "attach_file_name"
    t.string   "attach_content_type"
    t.integer  "attach_file_size"
    t.datetime "attach_updated_at"
    t.boolean  "permanent",           :default => false
    t.integer  "pcount"
    t.integer  "owner_id"
  end

  create_table "permissions", :force => true do |t|
    t.string   "action"
    t.string   "object"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "posts", :force => true do |t|
    t.integer  "activity_object_id"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "posts", ["activity_object_id"], :name => "index_posts_on_activity_object_id"

  create_table "private_student_groups", :force => true do |t|
    t.integer  "owner_id"
    t.text     "name"
    t.text     "users_data"
    t.datetime "created_at",                              :null => false
    t.datetime "updated_at",                              :null => false
    t.string   "teacher_notification", :default => "ALL"
  end

  create_table "profiles", :force => true do |t|
    t.integer  "actor_id"
    t.date     "birthday"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "organization", :limit => 45
    t.string   "phone",        :limit => 45
    t.string   "mobile",       :limit => 45
    t.string   "fax",          :limit => 45
    t.string   "address"
    t.string   "city"
    t.string   "zipcode",      :limit => 45
    t.string   "province",     :limit => 45
    t.string   "country",      :limit => 45
    t.integer  "prefix_key"
    t.text     "description"
    t.string   "experience"
    t.string   "website"
    t.string   "skype",        :limit => 45
    t.string   "im",           :limit => 45
  end

  add_index "profiles", ["actor_id"], :name => "index_profiles_on_actor_id"

  create_table "quiz_answers", :force => true do |t|
    t.integer  "quiz_session_id"
    t.datetime "created_at"
    t.text     "answer"
  end

  create_table "quiz_sessions", :force => true do |t|
    t.integer  "owner_id"
    t.string   "name"
    t.text     "quiz"
    t.boolean  "active",     :default => true
    t.string   "url"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.datetime "closed_at"
  end

  create_table "receipts", :force => true do |t|
    t.integer  "receiver_id"
    t.string   "receiver_type"
    t.integer  "notification_id",                                  :null => false
    t.boolean  "is_read",                       :default => false
    t.boolean  "trashed",                       :default => false
    t.boolean  "deleted",                       :default => false
    t.string   "mailbox_type",    :limit => 25
    t.datetime "created_at",                                       :null => false
    t.datetime "updated_at",                                       :null => false
  end

  add_index "receipts", ["notification_id"], :name => "index_receipts_on_notification_id"

  create_table "relation_permissions", :force => true do |t|
    t.integer  "relation_id"
    t.integer  "permission_id"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "relation_permissions", ["permission_id"], :name => "index_relation_permissions_on_permission_id"
  add_index "relation_permissions", ["relation_id"], :name => "index_relation_permissions_on_relation_id"

  create_table "relations", :force => true do |t|
    t.integer  "actor_id"
    t.string   "type"
    t.string   "name"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "sender_type"
    t.string   "receiver_type"
    t.string   "ancestry"
  end

  add_index "relations", ["actor_id"], :name => "index_relations_on_actor_id"
  add_index "relations", ["ancestry"], :name => "index_relations_on_ancestry"

  create_table "remote_subjects", :force => true do |t|
    t.integer  "actor_id"
    t.string   "webfinger_id"
    t.text     "webfinger_info"
    t.datetime "created_at",     :null => false
    t.datetime "updated_at",     :null => false
  end

  add_index "remote_subjects", ["actor_id"], :name => "index_remote_subjects_on_actor_id"

  create_table "roles", :force => true do |t|
    t.string   "name"
    t.integer  "value",      :default => 1
    t.datetime "created_at",                :null => false
    t.datetime "updated_at",                :null => false
  end

  create_table "rooms", :force => true do |t|
    t.integer  "actor_id"
    t.string   "name"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
  end

  add_index "rooms", ["actor_id"], :name => "index_rooms_on_actor_id"

  create_table "scormfiles", :force => true do |t|
    t.integer  "activity_object_id"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.text     "zipurl"
    t.text     "lourl"
    t.text     "zippath"
    t.text     "lopath"
    t.integer  "width",              :default => 800
    t.integer  "height",             :default => 600
    t.string   "file_file_name"
    t.string   "file_content_type"
    t.integer  "file_file_size"
    t.datetime "file_updated_at"
    t.string   "schema"
    t.string   "schemaversion"
    t.string   "scorm_version"
    t.string   "lohref"
    t.string   "loresourceurl"
    t.text     "lohrefs"
  end

  create_table "service_permissions", :force => true do |t|
    t.integer  "owner_id"
    t.string   "key"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
  end

  create_table "service_requests", :force => true do |t|
    t.integer  "owner_id"
    t.string   "status",                  :default => "Pending"
    t.string   "type"
    t.text     "description"
    t.string   "attachment_file_name"
    t.string   "attachment_content_type"
    t.integer  "attachment_file_size"
    t.datetime "attachment_updated_at"
    t.datetime "created_at",                                     :null => false
    t.datetime "updated_at",                                     :null => false
  end

  create_table "shortened_urls", :force => true do |t|
    t.integer  "owner_id"
    t.string   "owner_type", :limit => 20
    t.string   "url",                                     :null => false
    t.string   "unique_key", :limit => 10,                :null => false
    t.integer  "use_count",                :default => 0, :null => false
    t.datetime "created_at",                              :null => false
    t.datetime "updated_at",                              :null => false
  end

  add_index "shortened_urls", ["owner_id", "owner_type"], :name => "index_shortened_urls_on_owner_id_and_owner_type"
  add_index "shortened_urls", ["unique_key"], :name => "index_shortened_urls_on_unique_key", :unique => true
  add_index "shortened_urls", ["url"], :name => "index_shortened_urls_on_url"

  create_table "simple_captcha_data", :force => true do |t|
    t.string   "key",        :limit => 40
    t.string   "value",      :limit => 6
    t.datetime "created_at",               :null => false
    t.datetime "updated_at",               :null => false
  end

  add_index "simple_captcha_data", ["key"], :name => "idx_key"

  create_table "sites", :force => true do |t|
    t.text     "config"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
    t.string   "type"
    t.integer  "actor_id"
  end

  add_index "sites", ["actor_id"], :name => "index_sites_on_actor_id"

  create_table "spam_reports", :force => true do |t|
    t.integer  "activity_object_id"
    t.integer  "reporter_actor_id"
    t.text     "issue"
    t.integer  "report_value"
    t.datetime "created_at",                           :null => false
    t.datetime "updated_at",                           :null => false
    t.boolean  "pending",            :default => true
  end

  create_table "stats", :force => true do |t|
    t.string  "stat_name",                 :null => false
    t.integer "stat_value", :default => 0
  end

  create_table "taggings", :force => true do |t|
    t.integer  "tag_id"
    t.integer  "taggable_id"
    t.string   "taggable_type"
    t.integer  "tagger_id"
    t.string   "tagger_type"
    t.string   "context"
    t.datetime "created_at"
  end

  add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id"
  add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context"

  create_table "tags", :force => true do |t|
    t.string "name"
    t.string "plain_name"
  end

  create_table "ties", :force => true do |t|
    t.integer  "contact_id"
    t.integer  "relation_id"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "ties", ["contact_id"], :name => "index_ties_on_contact_id"
  add_index "ties", ["relation_id"], :name => "index_ties_on_relation_id"

  create_table "tracking_system_entries", :force => true do |t|
    t.string   "app_id"
    t.text     "data"
    t.datetime "created_at",                                  :null => false
    t.datetime "updated_at",                                  :null => false
    t.integer  "tracking_system_entry_id"
    t.text     "user_agent"
    t.text     "referrer"
    t.boolean  "user_logged",              :default => false
    t.integer  "related_entity_id"
    t.boolean  "checked",                  :default => false
  end

  create_table "users", :force => true do |t|
    t.string   "encrypted_password",       :default => ""
    t.string   "password_salt"
    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.string   "authentication_token"
    t.datetime "created_at",                                   :null => false
    t.datetime "updated_at",                                   :null => false
    t.integer  "actor_id"
    t.string   "language"
    t.boolean  "connected",                :default => false
    t.string   "status",                   :default => "chat"
    t.boolean  "chat_enabled",             :default => true
    t.integer  "occupation"
    t.string   "invitation_token"
    t.datetime "invitation_created_at"
    t.datetime "invitation_sent_at"
    t.datetime "invitation_accepted_at"
    t.integer  "invitation_limit"
    t.integer  "invited_by_id"
    t.string   "invited_by_type"
    t.integer  "private_student_group_id"
    t.string   "provider"
    t.string   "uid"
  end

  add_index "users", ["actor_id"], :name => "index_users_on_actor_id"
  add_index "users", ["invitation_token"], :name => "index_users_on_invitation_token", :unique => true
  add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true

  create_table "wa_assignments", :force => true do |t|
    t.text     "fulltext"
    t.text     "plaintext"
    t.boolean  "with_dates",              :default => false
    t.datetime "open_date"
    t.datetime "due_date"
    t.text     "available_contributions"
    t.datetime "created_at",                                 :null => false
    t.datetime "updated_at",                                 :null => false
  end

  create_table "wa_assignments_wa_contributions_galleries", :id => false, :force => true do |t|
    t.integer "wa_assignment_id"
    t.integer "wa_contributions_gallery_id"
  end

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

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

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

  create_table "wa_texts", :force => true do |t|
    t.text     "fulltext"
    t.text     "plaintext"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
  end

  create_table "wapp_auth_tokens", :force => true do |t|
    t.integer  "actor_id"
    t.string   "auth_token"
    t.datetime "expire_at"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
  end

  create_table "webapps", :force => true do |t|
    t.integer  "activity_object_id"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.text     "zipurl"
    t.text     "lourl"
    t.text     "zippath"
    t.text     "lopath"
    t.integer  "width",              :default => 800
    t.integer  "height",             :default => 600
    t.string   "file_file_name"
    t.string   "file_content_type"
    t.integer  "file_file_size"
    t.datetime "file_updated_at"
  end

  create_table "words", :force => true do |t|
    t.string  "value"
    t.integer "occurrences", :default => 0
  end

  create_table "workshop_activities", :force => true do |t|
    t.integer  "workshop_id"
    t.integer  "wa_id"
    t.string   "wa_type"
    t.integer  "position"
    t.string   "title"
    t.text     "description"
    t.datetime "created_at",  :null => false
    t.datetime "updated_at",  :null => false
  end

  create_table "workshops", :force => true do |t|
    t.integer  "activity_object_id"
    t.boolean  "draft",               :default => true
    t.datetime "created_at",                            :null => false
    t.datetime "updated_at",                            :null => false
    t.string   "banner_file_name"
    t.string   "banner_content_type"
    t.integer  "banner_file_size"
    t.datetime "banner_updated_at"
  end

  create_table "writings", :force => true do |t|
    t.integer  "activity_object_id"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.text     "fulltext"
    t.text     "plaintext"
  end

  add_foreign_key "activities", "activity_verbs", :name => "index_activities_on_activity_verb_id"

  add_foreign_key "activity_actions", "activity_objects", :name => "index_activity_actions_on_activity_object_id"
  add_foreign_key "activity_actions", "actors", :name => "index_activity_actions_on_actor_id"

  add_foreign_key "activity_object_activities", "activities", :name => "index_activity_object_activities_on_activity_id"
  add_foreign_key "activity_object_activities", "activity_objects", :name => "activity_object_activities_on_activity_object_id"

  add_foreign_key "activity_object_audiences", "activity_objects", :name => "activity_object_audiences_on_activity_object_id"
  add_foreign_key "activity_object_audiences", "relations", :name => "activity_object_audiences_on_relation_id"

  add_foreign_key "activity_object_properties", "activity_objects", :name => "index_activity_object_properties_on_activity_object_id"
  add_foreign_key "activity_object_properties", "activity_objects", :name => "index_activity_object_properties_on_property_id", :column => "property_id"

  add_foreign_key "actor_keys", "actors", :name => "actor_keys_on_actor_id"

  add_foreign_key "actors", "activity_objects", :name => "actors_on_activity_object_id"

  add_foreign_key "audiences", "activities", :name => "audiences_on_activity_id"
  add_foreign_key "audiences", "relations", :name => "audiences_on_relation_id"

  add_foreign_key "authentications", "users", :name => "authentications_on_user_id"

  add_foreign_key "comments", "activity_objects", :name => "comments_on_activity_object_id"

  add_foreign_key "contacts", "actors", :name => "contacts_on_receiver_id", :column => "receiver_id"
  add_foreign_key "contacts", "actors", :name => "contacts_on_sender_id", :column => "sender_id"

  add_foreign_key "documents", "activity_objects", :name => "documents_on_activity_object_id"

  add_foreign_key "events", "activity_objects", :name => "events_on_activity_object_id"
  add_foreign_key "events", "rooms", :name => "index_events_on_room_id"

  add_foreign_key "groups", "actors", :name => "groups_on_actor_id"

  add_foreign_key "links", "activity_objects", :name => "links_on_activity_object_id"

  add_foreign_key "notifications", "conversations", :name => "notifications_on_conversation_id"

  add_foreign_key "posts", "activity_objects", :name => "posts_on_activity_object_id"

  add_foreign_key "profiles", "actors", :name => "profiles_on_actor_id"

  add_foreign_key "receipts", "notifications", :name => "receipts_on_notification_id"

  add_foreign_key "relation_permissions", "permissions", :name => "relation_permissions_on_permission_id"
  add_foreign_key "relation_permissions", "relations", :name => "relation_permissions_on_relation_id"

  add_foreign_key "relations", "actors", :name => "relations_on_actor_id"

  add_foreign_key "remote_subjects", "actors", :name => "remote_subjects_on_actor_id"

  add_foreign_key "sites", "actors", :name => "index_sites_on_actor_id"

  add_foreign_key "ties", "contacts", :name => "ties_on_contact_id"
  add_foreign_key "ties", "relations", :name => "ties_on_relation_id"

  add_foreign_key "users", "actors", :name => "users_on_actor_id"

end
