schema.rb 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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 => 20130819160603) 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_webhook_at"
  37. end
  38. add_index "agents", ["schedule"], :name => "index_agents_on_schedule"
  39. add_index "agents", ["type"], :name => "index_agents_on_type"
  40. add_index "agents", ["user_id", "created_at"], :name => "index_agents_on_user_id_and_created_at"
  41. create_table "delayed_jobs", :force => true do |t|
  42. t.integer "priority", :default => 0
  43. t.integer "attempts", :default => 0
  44. t.text "handler"
  45. t.text "last_error"
  46. t.datetime "run_at"
  47. t.datetime "locked_at"
  48. t.datetime "failed_at"
  49. t.string "locked_by"
  50. t.string "queue"
  51. t.datetime "created_at", :null => false
  52. t.datetime "updated_at", :null => false
  53. end
  54. add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
  55. create_table "events", :force => true do |t|
  56. t.integer "user_id"
  57. t.integer "agent_id"
  58. t.decimal "lat", :precision => 15, :scale => 10
  59. t.decimal "lng", :precision => 15, :scale => 10
  60. t.text "payload", :limit => 16777215
  61. t.datetime "created_at", :null => false
  62. t.datetime "updated_at", :null => false
  63. end
  64. add_index "events", ["agent_id", "created_at"], :name => "index_events_on_agent_id_and_created_at"
  65. add_index "events", ["user_id", "created_at"], :name => "index_events_on_user_id_and_created_at"
  66. create_table "links", :force => true do |t|
  67. t.integer "source_id"
  68. t.integer "receiver_id"
  69. t.datetime "created_at", :null => false
  70. t.datetime "updated_at", :null => false
  71. end
  72. add_index "links", ["receiver_id", "source_id"], :name => "index_links_on_receiver_id_and_source_id"
  73. add_index "links", ["source_id", "receiver_id"], :name => "index_links_on_source_id_and_receiver_id"
  74. create_table "rails_admin_histories", :force => true do |t|
  75. t.text "message"
  76. t.string "username"
  77. t.integer "item"
  78. t.string "table"
  79. t.integer "month", :limit => 2
  80. t.integer "year", :limit => 8
  81. t.datetime "created_at", :null => false
  82. t.datetime "updated_at", :null => false
  83. end
  84. add_index "rails_admin_histories", ["item", "table", "month", "year"], :name => "index_rails_admin_histories"
  85. create_table "users", :force => true do |t|
  86. t.string "email", :default => "", :null => false
  87. t.string "encrypted_password", :default => "", :null => false
  88. t.string "reset_password_token"
  89. t.datetime "reset_password_sent_at"
  90. t.datetime "remember_created_at"
  91. t.integer "sign_in_count", :default => 0
  92. t.datetime "current_sign_in_at"
  93. t.datetime "last_sign_in_at"
  94. t.string "current_sign_in_ip"
  95. t.string "last_sign_in_ip"
  96. t.datetime "created_at", :null => false
  97. t.datetime "updated_at", :null => false
  98. t.boolean "admin", :default => false, :null => false
  99. t.integer "failed_attempts", :default => 0
  100. t.string "unlock_token"
  101. t.datetime "locked_at"
  102. t.string "username", :null => false
  103. t.string "invitation_code", :null => false
  104. end
  105. add_index "users", ["email"], :name => "index_users_on_email", :unique => true
  106. add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
  107. add_index "users", ["unlock_token"], :name => "index_users_on_unlock_token", :unique => true
  108. add_index "users", ["username"], :name => "index_users_on_username", :unique => true
  109. end