schema.rb 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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 => 20130126080736) do
  14. create_table "agents", :force => true do |t|
  15. t.integer "user_id"
  16. t.text "options"
  17. t.string "type"
  18. t.string "name"
  19. t.string "schedule"
  20. t.integer "events_count"
  21. t.datetime "last_check_at"
  22. t.datetime "last_receive_at"
  23. t.integer "last_checked_event_id"
  24. t.datetime "created_at", :null => false
  25. t.datetime "updated_at", :null => false
  26. t.text "memory", :limit => 2147483647
  27. end
  28. add_index "agents", ["schedule"], :name => "index_agents_on_schedule"
  29. add_index "agents", ["type"], :name => "index_agents_on_type"
  30. add_index "agents", ["user_id", "created_at"], :name => "index_agents_on_user_id_and_created_at"
  31. create_table "delayed_jobs", :force => true do |t|
  32. t.integer "priority", :default => 0
  33. t.integer "attempts", :default => 0
  34. t.text "handler"
  35. t.text "last_error"
  36. t.datetime "run_at"
  37. t.datetime "locked_at"
  38. t.datetime "failed_at"
  39. t.string "locked_by"
  40. t.string "queue"
  41. t.datetime "created_at", :null => false
  42. t.datetime "updated_at", :null => false
  43. end
  44. add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
  45. create_table "events", :force => true do |t|
  46. t.integer "user_id"
  47. t.integer "agent_id"
  48. t.decimal "lat", :precision => 15, :scale => 10
  49. t.decimal "lng", :precision => 15, :scale => 10
  50. t.text "payload", :limit => 16777215
  51. t.datetime "created_at", :null => false
  52. t.datetime "updated_at", :null => false
  53. end
  54. add_index "events", ["agent_id", "created_at"], :name => "index_events_on_agent_id_and_created_at"
  55. add_index "events", ["user_id", "created_at"], :name => "index_events_on_user_id_and_created_at"
  56. create_table "links", :force => true do |t|
  57. t.integer "source_id"
  58. t.integer "receiver_id"
  59. t.datetime "created_at", :null => false
  60. t.datetime "updated_at", :null => false
  61. end
  62. add_index "links", ["receiver_id", "source_id"], :name => "index_links_on_receiver_id_and_source_id"
  63. add_index "links", ["source_id", "receiver_id"], :name => "index_links_on_source_id_and_receiver_id"
  64. create_table "rails_admin_histories", :force => true do |t|
  65. t.text "message"
  66. t.string "username"
  67. t.integer "item"
  68. t.string "table"
  69. t.integer "month", :limit => 2
  70. t.integer "year", :limit => 8
  71. t.datetime "created_at", :null => false
  72. t.datetime "updated_at", :null => false
  73. end
  74. add_index "rails_admin_histories", ["item", "table", "month", "year"], :name => "index_rails_admin_histories"
  75. create_table "users", :force => true do |t|
  76. t.string "email", :default => "", :null => false
  77. t.string "encrypted_password", :default => "", :null => false
  78. t.string "reset_password_token"
  79. t.datetime "reset_password_sent_at"
  80. t.datetime "remember_created_at"
  81. t.integer "sign_in_count", :default => 0
  82. t.datetime "current_sign_in_at"
  83. t.datetime "last_sign_in_at"
  84. t.string "current_sign_in_ip"
  85. t.string "last_sign_in_ip"
  86. t.datetime "created_at", :null => false
  87. t.datetime "updated_at", :null => false
  88. t.boolean "admin", :default => false, :null => false
  89. t.integer "failed_attempts", :default => 0
  90. t.string "unlock_token"
  91. t.datetime "locked_at"
  92. t.string "username", :null => false
  93. t.string "invitation_code", :null => false
  94. end
  95. add_index "users", ["email"], :name => "index_users_on_email", :unique => true
  96. add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
  97. add_index "users", ["unlock_token"], :name => "index_users_on_unlock_token", :unique => true
  98. add_index "users", ["username"], :name => "index_users_on_username", :unique => true
  99. end