schema.rb 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. # encoding: UTF-8
  2. # This file is auto-generated from the current state of the database. Instead
  3. # of editing this file, please use the migrations feature of Active Record to
  4. # incrementally modify your database, and then regenerate this schema definition.
  5. #
  6. # Note that this schema.rb definition is the authoritative source for your
  7. # database schema. If you need to create the application database on another
  8. # system, you should be using db:schema:load, not running all the migrations
  9. # from scratch. The latter is a flawed and unsustainable approach (the more migrations
  10. # you'll amass, the slower it'll run and the greater likelihood for issues).
  11. #
  12. # It's strongly recommended to check this file into your version control system.
  13. ActiveRecord::Schema.define(:version => 20140408150825) do
  14. create_table "agent_logs", :force => true do |t|
  15. t.integer "agent_id", :null => false
  16. t.text "message", :null => false
  17. t.integer "level", :default => 3, :null => false
  18. t.integer "inbound_event_id"
  19. t.integer "outbound_event_id"
  20. t.datetime "created_at", :null => false
  21. t.datetime "updated_at", :null => false
  22. end
  23. create_table "agents", :force => true do |t|
  24. t.integer "user_id"
  25. t.text "options"
  26. t.string "type"
  27. t.string "name"
  28. t.string "schedule"
  29. t.integer "events_count"
  30. t.datetime "last_check_at"
  31. t.datetime "last_receive_at"
  32. t.integer "last_checked_event_id"
  33. t.datetime "created_at", :null => false
  34. t.datetime "updated_at", :null => false
  35. t.text "memory", :limit => 2147483647
  36. t.datetime "last_web_request_at"
  37. t.integer "keep_events_for", :default => 0, :null => false
  38. t.datetime "last_event_at"
  39. t.datetime "last_error_log_at"
  40. t.boolean "propagate_immediately", :default => false, :null => false
  41. end
  42. add_index "agents", ["schedule"], :name => "index_agents_on_schedule"
  43. add_index "agents", ["type"], :name => "index_agents_on_type"
  44. add_index "agents", ["user_id", "created_at"], :name => "index_agents_on_user_id_and_created_at"
  45. create_table "delayed_jobs", :force => true do |t|
  46. t.integer "priority", :default => 0
  47. t.integer "attempts", :default => 0
  48. t.text "handler", :limit => 16777215
  49. t.text "last_error"
  50. t.datetime "run_at"
  51. t.datetime "locked_at"
  52. t.datetime "failed_at"
  53. t.string "locked_by"
  54. t.string "queue"
  55. t.datetime "created_at", :null => false
  56. t.datetime "updated_at", :null => false
  57. end
  58. add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
  59. create_table "events", :force => true do |t|
  60. t.integer "user_id"
  61. t.integer "agent_id"
  62. t.decimal "lat", :precision => 15, :scale => 10
  63. t.decimal "lng", :precision => 15, :scale => 10
  64. t.text "payload", :limit => 16777215
  65. t.datetime "created_at", :null => false
  66. t.datetime "updated_at", :null => false
  67. t.datetime "expires_at"
  68. end
  69. add_index "events", ["agent_id", "created_at"], :name => "index_events_on_agent_id_and_created_at"
  70. add_index "events", ["expires_at"], :name => "index_events_on_expires_at"
  71. add_index "events", ["user_id", "created_at"], :name => "index_events_on_user_id_and_created_at"
  72. create_table "links", :force => true do |t|
  73. t.integer "source_id"
  74. t.integer "receiver_id"
  75. t.datetime "created_at", :null => false
  76. t.datetime "updated_at", :null => false
  77. t.integer "event_id_at_creation", :default => 0, :null => false
  78. end
  79. add_index "links", ["receiver_id", "source_id"], :name => "index_links_on_receiver_id_and_source_id"
  80. add_index "links", ["source_id", "receiver_id"], :name => "index_links_on_source_id_and_receiver_id"
  81. create_table "user_credentials", :force => true do |t|
  82. t.integer "user_id", :null => false
  83. t.string "credential_name", :null => false
  84. t.text "credential_value", :null => false
  85. t.datetime "created_at", :null => false
  86. t.datetime "updated_at", :null => false
  87. t.string "mode", :default => "text", :null => false
  88. end
  89. add_index "user_credentials", ["user_id", "credential_name"], :name => "index_user_credentials_on_user_id_and_credential_name", :unique => true
  90. create_table "users", :force => true do |t|
  91. t.string "email", :default => "", :null => false
  92. t.string "encrypted_password", :default => "", :null => false
  93. t.string "reset_password_token"
  94. t.datetime "reset_password_sent_at"
  95. t.datetime "remember_created_at"
  96. t.integer "sign_in_count", :default => 0
  97. t.datetime "current_sign_in_at"
  98. t.datetime "last_sign_in_at"
  99. t.string "current_sign_in_ip"
  100. t.string "last_sign_in_ip"
  101. t.datetime "created_at", :null => false
  102. t.datetime "updated_at", :null => false
  103. t.boolean "admin", :default => false, :null => false
  104. t.integer "failed_attempts", :default => 0
  105. t.string "unlock_token"
  106. t.datetime "locked_at"
  107. t.string "username", :null => false
  108. t.string "invitation_code", :null => false
  109. end
  110. add_index "users", ["email"], :name => "index_users_on_email", :unique => true
  111. add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
  112. add_index "users", ["unlock_token"], :name => "index_users_on_unlock_token", :unique => true
  113. add_index "users", ["username"], :name => "index_users_on_username", :unique => true
  114. end