main
 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 that you check this file into your version control system.
13
14ActiveRecord::Schema.define(version: 20150221192553) do
15
16  # These are extensions that must be enabled in order to support this database
17  enable_extension "plpgsql"
18  enable_extension "uuid-ossp"
19
20  create_table "agents", id: :uuid, default: "uuid_generate_v4()", force: :cascade do |t|
21    t.string   "hostname"
22    t.datetime "created_at", null: false
23    t.datetime "updated_at", null: false
24  end
25
26  create_table "dispositions", id: :uuid, default: "uuid_generate_v4()", force: :cascade do |t|
27    t.string   "fingerprint"
28    t.integer  "state"
29    t.datetime "created_at",  null: false
30    t.datetime "updated_at",  null: false
31  end
32
33  add_index "dispositions", ["fingerprint"], name: "index_dispositions_on_fingerprint", unique: true, using: :btree
34
35  create_table "events", id: :uuid, default: "uuid_generate_v4()", force: :cascade do |t|
36    t.string   "type"
37    t.json     "data"
38    t.datetime "created_at", null: false
39    t.datetime "updated_at", null: false
40    t.uuid     "agent_id",   null: false
41  end
42
43  add_index "events", ["agent_id"], name: "index_events_on_agent_id", using: :btree
44
45  create_table "file_reports", id: :uuid, default: "uuid_generate_v4()", force: :cascade do |t|
46    t.uuid     "disposition_id"
47    t.json     "data"
48    t.datetime "created_at",     null: false
49    t.datetime "updated_at",     null: false
50  end
51
52  create_table "users", id: :uuid, default: "uuid_generate_v4()", force: :cascade do |t|
53    t.string   "username",        null: false
54    t.string   "password_digest", null: false
55    t.datetime "created_at",      null: false
56    t.datetime "updated_at",      null: false
57  end
58
59  add_index "users", ["username"], name: "index_users_on_username", unique: true, using: :btree
60
61end