rearview 1.2.0-jruby → 1.2.1-jruby

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/rearview/jobs_controller.rb +1 -0
  3. data/app/controllers/rearview/monitor_controller.rb +6 -2
  4. data/lib/generators/templates/README.md +3 -2
  5. data/lib/generators/templates/rearview.rb +1 -1
  6. data/lib/graphite/client.rb +2 -2
  7. data/lib/rearview/version.rb +1 -1
  8. data/public/rearview-src/help/cron.html +34 -0
  9. data/public/rearview-src/js/app.js +2 -1
  10. data/public/rearview-src/js/main.js +2 -2
  11. data/public/rearview-src/js/util/cron.js +50 -0
  12. data/public/rearview-src/js/view/addmonitor.js +111 -19
  13. data/public/rearview-src/js/view/expandedmonitor.js +112 -34
  14. data/public/rearview-src/less/rearview.less +64 -2
  15. data/public/rearview-src/templates/expandedmonitor.hbs +71 -43
  16. data/public/rearview-src/templates/schedulemonitor.hbs +36 -7
  17. data/public/rearview/build.txt +2 -1
  18. data/public/rearview/help/cron.html +34 -0
  19. data/public/rearview/js/app.js +1 -1
  20. data/public/rearview/js/main.js +23 -23
  21. data/public/rearview/js/util/cron.js +1 -0
  22. data/public/rearview/js/view/addmonitor.js +1 -1
  23. data/public/rearview/js/view/expandedmonitor.js +1 -1
  24. data/public/rearview/less/rearview.less +64 -2
  25. data/public/rearview/templates/expandedmonitor.hbs +71 -43
  26. data/public/rearview/templates/schedulemonitor.hbs +36 -7
  27. data/spec/controllers/dashboard_children_controller_spec.rb +4 -4
  28. data/spec/controllers/dashboards_controller_spec.rb +7 -7
  29. data/spec/controllers/jobs_controller_spec.rb +20 -11
  30. data/spec/controllers/monitor_controller_spec.rb +21 -4
  31. data/spec/controllers/user_controller_spec.rb +2 -2
  32. data/spec/dummy/log/development.log +90 -0
  33. data/spec/dummy/log/test.log +16754 -0
  34. data/spec/lib/graphite/client_spec.rb +9 -1
  35. data/spec/views/metric/create.json.jbuilder_spec.rb +31 -0
  36. metadata +8 -2
@@ -104,49 +104,77 @@
104
104
  </form>
105
105
  </div>
106
106
  <div class='tab-pane' id='viewSchedule'>
107
- <div class='monitor-schedule'>
108
- <fieldset class='form-horizontal'>
109
- <div class='control-group'>
110
- <label for='inputMinutes'>Minutes</label>
111
- <input type='text' id='inputMinutes' name='inputMinutes' value='*' class='input-mini'>
112
- </div>
113
- <div class='control-group'>
114
- <label for='inputHours'>Hours</label>
115
- <input type='text' id='inputHours' name='inputHours' value='*' class='input-mini'>
116
- </div>
117
- <div class='control-group'>
118
- <label for='inputDays'>Days</label>
119
- <input type='text' id='inputDays' name='inputDays' value='*' class='input-mini'>
120
- </div>
121
- </fieldset>
122
- <fieldset class='day-month-picker'>
123
- <label>Weekday</label>
124
- <div class='day-picker btn-group' data-toggle='buttons-checkbox'>
125
- <button type='button' class='sun btn btn-inverse' data-value='Sun'>Sun</button>
126
- <button type='button' class='mon btn btn-inverse' data-value='Mon'>Mon</button>
127
- <button type='button' class='tue btn btn-inverse' data-value='Tue'>Tue</button>
128
- <button type='button' class='wed btn btn-inverse' data-value='Wed'>Wed</button>
129
- <button type='button' class='thu btn btn-inverse' data-value='Thu'>Thu</button>
130
- <button type='button' class='fri btn btn-inverse' data-value='Fri'>Fri</button>
131
- <button type='button' class='sat btn btn-inverse' data-value='Sat'>Sat</button>
132
- </div>
133
- <label>Month</label>
134
- <div class='month-picker btn-group' data-toggle='buttons-checkbox'>
135
- <button type='button' class='jan btn btn-inverse' data-value='Jan'>Jan</button>
136
- <button type='button' class='feb btn btn-inverse' data-value='Feb'>Feb</button>
137
- <button type='button' class='mar btn btn-inverse' data-value='Mar'>Mar</button>
138
- <button type='button' class='apr btn btn-inverse' data-value='Apr'>Apr</button>
139
- <button type='button' class='may btn btn-inverse' data-value='May'>May</button>
140
- <button type='button' class='jun btn btn-inverse' data-value='Jun'>Jun</button>
141
- <button type='button' class='jul btn btn-inverse' data-value='Jul'>Jul</button>
142
- <button type='button' class='aug btn btn-inverse' data-value='Aug'>Aug</button>
143
- <button type='button' class='sep btn btn-inverse' data-value='Sep'>Sep</button>
144
- <button type='button' class='oct btn btn-inverse' data-value='Oct'>Oct</button>
145
- <button type='button' class='nov btn btn-inverse' data-value='Nov'>Nov</button>
146
- <button type='button' class='dec btn btn-inverse' data-value='Dec'>Dec</button>
147
- </div>
148
- </fieldset>
149
- </div>
107
+ <form id='cronScheduleFormEdit' class='clearfix'>
108
+ <span title='' data-original-title='' class='help label label-info'><i class='icon-info-sign'></i></span>
109
+ <div class='monitor-schedule'>
110
+ <fieldset class='form-horizontal'>
111
+ <div class='control-group'>
112
+ <label for='inputMinutes'>Minutes</label>
113
+ <input type='text'
114
+ id='inputMinutes'
115
+ name='inputMinutes'
116
+ value='0'
117
+ class='input-mini'
118
+ data-trigger='blur mouseout'
119
+ data-error-message="Not a valid value for cron field 'minutes'"
120
+ data-cronfield='minute'
121
+ required='required'>
122
+ </div>
123
+ <div class='control-group'>
124
+ <label for='inputHours'>Hours</label>
125
+ <input type='text'
126
+ id='inputHours'
127
+ name='inputHours'
128
+ value='*'
129
+ class='input-mini'
130
+ data-trigger='blur mouseout'
131
+ data-error-message="Not a valid value for cron field 'hours'"
132
+ data-cronfield='hour'
133
+ required='required'>
134
+ </div>
135
+ <div class='control-group'>
136
+ <label for='inputDays'>Days</label>
137
+ <input type='text'
138
+ id='inputDays'
139
+ name='inputDays'
140
+ value='*'
141
+ class='input-mini'
142
+ data-trigger='blur mouseout'
143
+ data-error-message="Not a valid value for cron field 'days'"
144
+ data-cronfield='day'
145
+ required='required'>
146
+ </div>
147
+ </fieldset>
148
+ <fieldset class='day-month-picker'>
149
+ <label>Weekday</label>
150
+ <div class='day-picker btn-group'>
151
+ <button type='button' class='sun btn btn-inverse' data-value='1'>Sun</button>
152
+ <button type='button' class='mon btn btn-inverse' data-value='2'>Mon</button>
153
+ <button type='button' class='tue btn btn-inverse' data-value='3'>Tue</button>
154
+ <button type='button' class='wed btn btn-inverse' data-value='4'>Wed</button>
155
+ <button type='button' class='thu btn btn-inverse' data-value='5'>Thu</button>
156
+ <button type='button' class='fri btn btn-inverse' data-value='6'>Fri</button>
157
+ <button type='button' class='sat btn btn-inverse' data-value='7'>Sat</button>
158
+ </div>
159
+ <label>Month</label>
160
+ <div class='month-picker btn-group' data-toggle='buttons-checkbox'>
161
+ <button type='button' class='jan btn btn-inverse' data-value='1'>Jan</button>
162
+ <button type='button' class='feb btn btn-inverse' data-value='2'>Feb</button>
163
+ <button type='button' class='mar btn btn-inverse' data-value='3'>Mar</button>
164
+ <button type='button' class='apr btn btn-inverse' data-value='4'>Apr</button>
165
+ <button type='button' class='may btn btn-inverse' data-value='5'>May</button>
166
+ <button type='button' class='jun btn btn-inverse' data-value='6'>Jun</button>
167
+ <button type='button' class='jul btn btn-inverse' data-value='7'>Jul</button>
168
+ <button type='button' class='aug btn btn-inverse' data-value='8'>Aug</button>
169
+ <button type='button' class='sep btn btn-inverse' data-value='9'>Sep</button>
170
+ <button type='button' class='oct btn btn-inverse' data-value='10'>Oct</button>
171
+ <button type='button' class='nov btn btn-inverse' data-value='11'>Nov</button>
172
+ <button type='button' class='dec btn btn-inverse' data-value='12'>Dec</button>
173
+ </div>
174
+ </fieldset>
175
+ </div>
176
+ </form>
177
+ <div id="cronScheduleFormEditErrors"></div>
150
178
  </div>
151
179
  <div class='tab-pane' id='viewSettings'>
152
180
  <div class='clearfix'>
@@ -11,40 +11,68 @@
11
11
  <textarea rows='3' id='description' name='description'></textarea>
12
12
  </fieldset>
13
13
  <fieldset class='pager-duty control-group'>
14
- <label for='pagerDuty' class='control-label'>Add Alert URIs (Not Required):</label>
14
+ <label for='pagerDuty' class='control-label'>Add Alert URIs (Not Required):
15
+ <span class="help label label-info" data-original-title="" title=""><i class="icon-info-sign"></i></span>
16
+ </label>
15
17
  <textarea rows='3' id='pagerDuty' name='pagerDuty' placeholder='Multiple alert URIs can be entered (separated by a space, comma or new line).'>{{#user.preferences.alertKeys}}{{this}}
16
18
  {{/user.preferences.alertKeys}}</textarea>
17
19
  </fieldset>
18
20
  </form>
19
21
  </div>
20
22
  <div class='hero-unit'>
21
- <form class='clearfix'>
23
+ <form id='cronScheduleForm' class='clearfix'>
22
24
  <fieldset class='set-schedule'>
23
- <label>Set Schedule:</label>
25
+ <label>Set Schedule:
26
+ <span class="help label label-info" data-original-title="" title=""><i class="icon-info-sign"></i></span>
27
+ </label>
24
28
  </fieldset>
25
29
  <fieldset class='form-horizontal'>
26
30
  <div class='control-group'>
27
31
  <label class='control-label' for='inputMinutes'>Minutes</label>
28
32
  <div class='controls'>
29
- <input type='text' id='inputMinutes' name='inputMinutes' value='*' class='input-mini'>
33
+ <input type='text'
34
+ id='inputMinutes'
35
+ name='inputMinutes'
36
+ value='0'
37
+ class='input-mini'
38
+ data-trigger='blur mouseout'
39
+ data-error-message="Not a valid value for cron field 'minutes'"
40
+ data-cronfield='minute'
41
+ required='required'>
30
42
  </div>
31
43
  </div>
32
44
  <div class='control-group'>
33
45
  <label class='control-label' for='inputHours'>Hours</label>
34
46
  <div class='controls'>
35
- <input type='text' id='inputHours' name='inputHours' value='*' class='input-mini'>
47
+ <input type='text'
48
+ id='inputHours'
49
+ name='inputHours'
50
+ value='*'
51
+ class='input-mini'
52
+ data-trigger='blur mouseout'
53
+ data-error-message="Not a valid value for cron field 'hours'"
54
+ data-cronfield='hour'
55
+ required='required'>
36
56
  </div>
37
57
  </div>
38
58
  <div class='control-group'>
39
59
  <label class='control-label' for='inputDays'>Days</label>
40
60
  <div class='controls'>
41
- <input type='text' id='inputDays' name='inputDays' value='*' class='input-mini'>
61
+ <input type='text'
62
+ id='inputDays'
63
+ name='inputDays'
64
+ value='*'
65
+ class='input-mini'
66
+ data-trigger='blur mouseout'
67
+ data-error-message="Not a valid value for cron field 'days'"
68
+ data-cronfield='day'
69
+ required='required'>
42
70
  </div>
43
71
  </div>
44
72
  </fieldset>
45
73
  <fieldset class='day-month-picker'>
46
74
  <label>Weekday</label>
47
- <div class='day-picker btn-group' data-toggle='buttons-checkbox'>
75
+ <div class='day-picker btn-group'>
48
76
  <button type='button' class='sun btn' data-value='Sun'>Sun</button>
49
77
  <button type='button' class='mon btn' data-value='Mon'>Mon</button>
50
78
  <button type='button' class='tue btn' data-value='Tue'>Tue</button>
@@ -70,6 +98,7 @@
70
98
  </div>
71
99
  </fieldset>
72
100
  </form>
101
+ <div id='cronScheduleFormErrors'></div>
73
102
  </div>
74
103
  </div>
75
104
  <div class='modal-footer'>
@@ -9,18 +9,18 @@ describe Rearview::DashboardChildrenController do
9
9
  end
10
10
 
11
11
  context "GET /children" do
12
- it "renders the index view" do
12
+ it "renders the dashboards index view" do
13
13
  get :index, dashboard_id: parent.id, format: :json
14
- render_template(:index)
14
+ expect(response).to render_template("rearview/dashboards/index")
15
15
  end
16
16
  end
17
17
 
18
18
  context "POST /children" do
19
- it "renders the create view" do
19
+ it "renders the dashboards show view" do
20
20
  json = JsonFactory::Dashboard.create(build(:dashboard))
21
21
  json[:dashboard_id] = parent.id
22
22
  post :create, json
23
- render_template(:create)
23
+ expect(response).to render_template("rearview/dashboards/show")
24
24
  end
25
25
  it "creates the child association to the parent" do
26
26
  dashboard = build(:dashboard)
@@ -10,7 +10,7 @@ describe Rearview::DashboardsController do
10
10
  context "GET /dashboards" do
11
11
  it "renders the index view" do
12
12
  get :index, format: :json
13
- render_template(:index)
13
+ expect(response).to render_template("rearview/dashboards/index")
14
14
  end
15
15
  end
16
16
 
@@ -18,7 +18,7 @@ describe Rearview::DashboardsController do
18
18
  it "renders the show view" do
19
19
  app = create(:dashboard)
20
20
  get :show, id: app.id, format: :json
21
- render_template(:show)
21
+ expect(response).to render_template("rearview/dashboards/show")
22
22
  end
23
23
  end
24
24
 
@@ -26,7 +26,7 @@ describe Rearview::DashboardsController do
26
26
  it "renders the errors view" do
27
27
  app = create(:dashboard)
28
28
  get :errors, id: app.id, format: :json
29
- render_template(:errors)
29
+ expect(response).to render_template("rearview/dashboards/errors")
30
30
  end
31
31
  end
32
32
 
@@ -34,7 +34,7 @@ describe Rearview::DashboardsController do
34
34
  it "renders the create view" do
35
35
  app = build(:dashboard)
36
36
  post :create, JsonFactory::Dashboard.create(app)
37
- render_template(:create)
37
+ expect(response).to render_template("rearview/dashboards/show")
38
38
  end
39
39
  end
40
40
 
@@ -47,15 +47,15 @@ describe Rearview::DashboardsController do
47
47
  json["userId"]=app1.user_id
48
48
  end
49
49
  put :update, params
50
- render_template(:update)
50
+ expect(response).to render_template("rearview/dashboards/show")
51
51
  end
52
52
  end
53
53
 
54
54
  context "DELETE /dashboards/:id" do
55
- it "renders the destroy view" do
55
+ it "renders the show view" do
56
56
  app = create(:dashboard)
57
57
  delete :destroy, id: app.id, format: :json
58
- render_template(:destroy)
58
+ expect(response).to render_template("rearview/dashboards/show")
59
59
  end
60
60
  end
61
61
 
@@ -11,7 +11,7 @@ describe Rearview::JobsController do
11
11
  context "GET /jobs" do
12
12
  it "renders the index view" do
13
13
  get :index, format: :json
14
- render_template(:index)
14
+ expect(response).to render_template("rearview/jobs/index")
15
15
  end
16
16
  end
17
17
 
@@ -19,7 +19,7 @@ describe Rearview::JobsController do
19
19
  it "renders the show view" do
20
20
  job = create(:job)
21
21
  get :show, id: job.id, format: :json
22
- render_template(:show)
22
+ expect(response).to render_template("rearview/jobs/show")
23
23
  end
24
24
  end
25
25
 
@@ -27,7 +27,7 @@ describe Rearview::JobsController do
27
27
  it "renders the errors view" do
28
28
  job = create(:job)
29
29
  get :errors, id: job.id, format: :json
30
- render_template(:errors)
30
+ expect(response).to render_template("rearview/jobs/errors")
31
31
  end
32
32
  end
33
33
 
@@ -36,7 +36,7 @@ describe Rearview::JobsController do
36
36
  job = create(:job)
37
37
  job_data = create(:job_data,:job=>job)
38
38
  get :data, id: job.id, format: :json
39
- render_template(:data)
39
+ expect(response).to render_template("rearview/jobs/data")
40
40
  end
41
41
  it "returns status 404 if there is no data" do
42
42
  job = create(:job)
@@ -46,11 +46,11 @@ describe Rearview::JobsController do
46
46
  end
47
47
 
48
48
  context "POST /jobs" do
49
- it "renders the create view" do
49
+ it "renders the show view" do
50
50
  job = build(:job)
51
51
  Rearview::Job.any_instance.expects(:sync_monitor_service)
52
52
  post :create, JsonFactory::Job.create(job)
53
- render_template(:show)
53
+ expect(response).to render_template("rearview/jobs/show")
54
54
  end
55
55
  end
56
56
 
@@ -59,9 +59,9 @@ describe Rearview::JobsController do
59
59
  before do
60
60
  Rearview::Job.any_instance.expects(:sync_monitor_service)
61
61
  end
62
- it "renders the update view" do
62
+ it "renders the show view" do
63
63
  put :update, JsonFactory::Job.update(job)
64
- render_template(:show)
64
+ expect(response).to render_template("rearview/jobs/show")
65
65
  end
66
66
  it "allows the dashboard to be updated" do
67
67
  dashboard = create(:dashboard)
@@ -69,16 +69,25 @@ describe Rearview::JobsController do
69
69
  job_json = JsonFactory::Job.update(job)
70
70
  job_json["dashboard_id"] = dashboard.id
71
71
  put :update, job_json
72
+ expect(response).to render_template("rearview/jobs/show")
73
+ end
74
+ it "allows the alert keys to be emptied" do
75
+ job_json = JsonFactory::Job.update(job)
76
+ job_json["alertKeys"] = nil
77
+ put :update, job_json
78
+ job.reload
79
+ expect(job.alert_keys).to eq([])
80
+ expect(response).to render_template("rearview/jobs/show")
72
81
  end
73
82
  end
74
83
 
75
84
  context "DELETE /jobs/:id" do
76
85
  let(:job) { create(:job) }
77
- it "renders the destroy view" do
86
+ it "renders the show view" do
78
87
  job.expects(:unschedule)
79
88
  Rearview::Job.expects(:find).with(job.id.to_s).returns(job)
80
89
  delete :destroy, id: job.id, format: :json
81
- render_template(:destroy)
90
+ expect(response).to render_template("rearview/jobs/show")
82
91
  end
83
92
  end
84
93
 
@@ -88,7 +97,7 @@ describe Rearview::JobsController do
88
97
  Rearview::Job.stubs(:find).returns(job)
89
98
  job.expects(:reset)
90
99
  put :reset, JsonFactory::Job.update(job)
91
- render_template(:show)
100
+ expect(response).to render_template("rearview/jobs/show")
92
101
  end
93
102
  end
94
103
 
@@ -8,14 +8,31 @@ describe Rearview::MonitorController do
8
8
  end
9
9
 
10
10
  context "POST /monitor" do
11
- before do
12
- Rearview::MetricsValidator.any_instance.stubs(:metric_valid?).returns(true)
13
- end
14
11
  it "renders the create view" do
12
+ Rearview::MetricsValidator.any_instance.stubs(:metric_valid?).returns(true)
15
13
  json = JsonFactory::Monitor.create
16
14
  Rearview::MonitorRunner.expects(:run).with(json["metrics"],json["monitorExpr"],json["minutes"].to_s,{},false,json["toDate"],true).once
17
15
  post :create, json
18
- render_template(:create)
16
+ expect(response).to render_template("rearview/monitor/create")
17
+ end
18
+ context "invalid metrics" do
19
+ it "provides an error message when no metrics are provided" do
20
+ json = JsonFactory::Monitor.create
21
+ json["metrics"] = []
22
+ Rearview::MonitorRunner.expects(:run).never
23
+ Rearview::MetricsValidator.expects(:metric_valid?).never
24
+ post :create, json
25
+ expect(assigns(:errors)).to include("No metrics were provided")
26
+ expect(response).to render_template("rearview/monitor/create")
27
+ end
28
+ it "provides an error message when metrics are invalid" do
29
+ json = JsonFactory::Monitor.create
30
+ Rearview::MonitorRunner.expects(:run).never
31
+ Rearview::MetricsValidator.any_instance.stubs(:metric_valid?).returns(false)
32
+ post :create, json
33
+ expect(assigns(:errors)).to include("Metrics contains an invalid metric: #{json["metrics"].first}")
34
+ expect(response).to render_template("rearview/monitor/create")
35
+ end
19
36
  end
20
37
  end
21
38
 
@@ -11,7 +11,7 @@ describe Rearview::UserController do
11
11
  context "GET /user" do
12
12
  it "renders the show view" do
13
13
  get :show, format: :json
14
- render_template(:show)
14
+ expect(response).to render_template("rearview/user/show")
15
15
  end
16
16
  end
17
17
  context "PUT /user" do
@@ -21,7 +21,7 @@ describe Rearview::UserController do
21
21
  JSON.stubs(:parse).returns(preferences: json["preferences"])
22
22
  user.expects(:save!)
23
23
  put :update, json
24
- render_template(:show)
24
+ expect(response).to render_template("rearview/user/show")
25
25
  end
26
26
  end
27
27
  end
@@ -1553,3 +1553,93 @@
1553
1553
   (11.0ms) CREATE UNIQUE INDEX `unique_schema_migrations` ON `schema_migrations` (`version`)
1554
1554
   (2.0ms) SELECT version FROM `schema_migrations`
1555
1555
   (2.0ms) INSERT INTO `schema_migrations` (version) VALUES ('20131106162900')
1556
+  (53.0ms) DROP DATABASE IF EXISTS `rearview_ruby_test`
1557
+  (5.0ms) CREATE DATABASE `rearview_ruby_test` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`
1558
+  (64.0ms) CREATE TABLE `applications` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `user_id` int(11), `name` varchar(255) NOT NULL, `created_at` datetime, `updated_at` datetime, `deleted_at` datetime, `ancestry` varchar(255), `description` varchar(255)) ENGINE=InnoDB DEFAULT CHARSET=utf8
1559
+  (16.0ms) CREATE INDEX `index_applications_on_ancestry` ON `applications` (`ancestry`)
1560
+  (10.0ms) CREATE INDEX `user_id` ON `applications` (`user_id`)
1561
+  (15.0ms) CREATE TABLE `job_data` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `job_id` int(11) DEFAULT 0 NOT NULL, `created_at` datetime, `updated_at` datetime, `data` longtext NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8
1562
+  (8.0ms) CREATE TABLE `job_errors` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `job_id` int(11), `created_at` datetime, `message` longtext, `status` varchar(255), `last_alerted_at` datetime, `updated_at` datetime) ENGINE=InnoDB DEFAULT CHARSET=utf8
1563
+  (9.0ms) CREATE INDEX `job_id` ON `job_errors` (`job_id`)
1564
+  (15.0ms) CREATE TABLE `jobs` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `created_at` datetime, `updated_at` datetime, `name` varchar(255) NOT NULL, `active` tinyint(1) DEFAULT 1 NOT NULL, `last_run` datetime, `cron_expr` varchar(1024) NOT NULL, `status` varchar(255), `user_id` int(11), `alert_keys` text, `deleted_at` datetime, `error_timeout` int(11) DEFAULT 60 NOT NULL, `next_run` datetime, `description` text, `app_id` int(11) NOT NULL, `metrics` text NOT NULL, `monitor_expr` text, `minutes` int(11), `to_date` text) ENGINE=InnoDB DEFAULT CHARSET=utf8
1565
+  (9.0ms) CREATE INDEX `app_id` ON `jobs` (`app_id`)
1566
+  (14.0ms) CREATE UNIQUE INDEX `id_name_version_key` ON `jobs` (`id`, `name`)
1567
+  (8.0ms) CREATE INDEX `jobs_ibfk_1` ON `jobs` (`user_id`)
1568
+  (13.0ms) CREATE TABLE `users` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `created_at` datetime, `updated_at` datetime, `encrypted_password` varchar(255) DEFAULT '' NOT NULL, `email` varchar(255) NOT NULL, `first_name` varchar(255), `last_name` varchar(255), `last_login` datetime, `preferences` text) ENGINE=InnoDB DEFAULT CHARSET=utf8
1569
+  (9.0ms) CREATE UNIQUE INDEX `email` ON `users` (`email`)
1570
+  (13.0ms) CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8
1571
+  (10.0ms) CREATE UNIQUE INDEX `unique_schema_migrations` ON `schema_migrations` (`version`)
1572
+  (1.0ms) SELECT version FROM `schema_migrations`
1573
+  (1.0ms) INSERT INTO `schema_migrations` (version) VALUES ('20131106162900')
1574
+  (7.0ms) DROP DATABASE IF EXISTS `rearview_ruby_test`
1575
+  (2.0ms) CREATE DATABASE `rearview_ruby_test` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`
1576
+  (29.0ms) CREATE TABLE `applications` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `user_id` int(11), `name` varchar(255) NOT NULL, `created_at` datetime, `updated_at` datetime, `deleted_at` datetime, `ancestry` varchar(255), `description` varchar(255)) ENGINE=InnoDB DEFAULT CHARSET=utf8
1577
+  (10.0ms) CREATE INDEX `index_applications_on_ancestry` ON `applications` (`ancestry`)
1578
+  (10.0ms) CREATE INDEX `user_id` ON `applications` (`user_id`)
1579
+  (13.0ms) CREATE TABLE `job_data` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `job_id` int(11) DEFAULT 0 NOT NULL, `created_at` datetime, `updated_at` datetime, `data` longtext NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8
1580
+  (7.0ms) CREATE TABLE `job_errors` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `job_id` int(11), `created_at` datetime, `message` longtext, `status` varchar(255), `last_alerted_at` datetime, `updated_at` datetime) ENGINE=InnoDB DEFAULT CHARSET=utf8
1581
+  (11.0ms) CREATE INDEX `job_id` ON `job_errors` (`job_id`)
1582
+  (13.0ms) CREATE TABLE `jobs` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `created_at` datetime, `updated_at` datetime, `name` varchar(255) NOT NULL, `active` tinyint(1) DEFAULT 1 NOT NULL, `last_run` datetime, `cron_expr` varchar(1024) NOT NULL, `status` varchar(255), `user_id` int(11), `alert_keys` text, `deleted_at` datetime, `error_timeout` int(11) DEFAULT 60 NOT NULL, `next_run` datetime, `description` text, `app_id` int(11) NOT NULL, `metrics` text NOT NULL, `monitor_expr` text, `minutes` int(11), `to_date` text) ENGINE=InnoDB DEFAULT CHARSET=utf8
1583
+  (9.0ms) CREATE INDEX `app_id` ON `jobs` (`app_id`)
1584
+  (16.0ms) CREATE UNIQUE INDEX `id_name_version_key` ON `jobs` (`id`, `name`)
1585
+  (8.0ms) CREATE INDEX `jobs_ibfk_1` ON `jobs` (`user_id`)
1586
+  (11.0ms) CREATE TABLE `users` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `created_at` datetime, `updated_at` datetime, `encrypted_password` varchar(255) DEFAULT '' NOT NULL, `email` varchar(255) NOT NULL, `first_name` varchar(255), `last_name` varchar(255), `last_login` datetime, `preferences` text) ENGINE=InnoDB DEFAULT CHARSET=utf8
1587
+  (8.0ms) CREATE UNIQUE INDEX `email` ON `users` (`email`)
1588
+  (14.0ms) CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8
1589
+  (13.0ms) CREATE UNIQUE INDEX `unique_schema_migrations` ON `schema_migrations` (`version`)
1590
+  (1.0ms) SELECT version FROM `schema_migrations`
1591
+  (2.0ms) INSERT INTO `schema_migrations` (version) VALUES ('20131106162900')
1592
+  (12.0ms) DROP DATABASE IF EXISTS `rearview_ruby_test`
1593
+  (2.0ms) CREATE DATABASE `rearview_ruby_test` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`
1594
+  (24.0ms) CREATE TABLE `applications` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `user_id` int(11), `name` varchar(255) NOT NULL, `created_at` datetime, `updated_at` datetime, `deleted_at` datetime, `ancestry` varchar(255), `description` varchar(255)) ENGINE=InnoDB DEFAULT CHARSET=utf8
1595
+  (9.0ms) CREATE INDEX `index_applications_on_ancestry` ON `applications` (`ancestry`)
1596
+  (12.0ms) CREATE INDEX `user_id` ON `applications` (`user_id`)
1597
+  (15.0ms) CREATE TABLE `job_data` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `job_id` int(11) DEFAULT 0 NOT NULL, `created_at` datetime, `updated_at` datetime, `data` longtext NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8
1598
+  (7.0ms) CREATE TABLE `job_errors` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `job_id` int(11), `created_at` datetime, `message` longtext, `status` varchar(255), `last_alerted_at` datetime, `updated_at` datetime) ENGINE=InnoDB DEFAULT CHARSET=utf8
1599
+  (9.0ms) CREATE INDEX `job_id` ON `job_errors` (`job_id`)
1600
+  (14.0ms) CREATE TABLE `jobs` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `created_at` datetime, `updated_at` datetime, `name` varchar(255) NOT NULL, `active` tinyint(1) DEFAULT 1 NOT NULL, `last_run` datetime, `cron_expr` varchar(1024) NOT NULL, `status` varchar(255), `user_id` int(11), `alert_keys` text, `deleted_at` datetime, `error_timeout` int(11) DEFAULT 60 NOT NULL, `next_run` datetime, `description` text, `app_id` int(11) NOT NULL, `metrics` text NOT NULL, `monitor_expr` text, `minutes` int(11), `to_date` text) ENGINE=InnoDB DEFAULT CHARSET=utf8
1601
+  (9.0ms) CREATE INDEX `app_id` ON `jobs` (`app_id`)
1602
+  (16.0ms) CREATE UNIQUE INDEX `id_name_version_key` ON `jobs` (`id`, `name`)
1603
+  (8.0ms) CREATE INDEX `jobs_ibfk_1` ON `jobs` (`user_id`)
1604
+  (13.0ms) CREATE TABLE `users` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `created_at` datetime, `updated_at` datetime, `encrypted_password` varchar(255) DEFAULT '' NOT NULL, `email` varchar(255) NOT NULL, `first_name` varchar(255), `last_name` varchar(255), `last_login` datetime, `preferences` text) ENGINE=InnoDB DEFAULT CHARSET=utf8
1605
+  (15.0ms) CREATE UNIQUE INDEX `email` ON `users` (`email`)
1606
+  (7.0ms) CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8
1607
+  (10.0ms) CREATE UNIQUE INDEX `unique_schema_migrations` ON `schema_migrations` (`version`)
1608
+  (1.0ms) SELECT version FROM `schema_migrations`
1609
+  (1.0ms) INSERT INTO `schema_migrations` (version) VALUES ('20131106162900')
1610
+  (42.0ms) DROP DATABASE IF EXISTS `rearview_ruby_test`
1611
+  (26.0ms) CREATE DATABASE `rearview_ruby_test` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`
1612
+  (53.0ms) CREATE TABLE `applications` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `user_id` int(11), `name` varchar(255) NOT NULL, `created_at` datetime, `updated_at` datetime, `deleted_at` datetime, `ancestry` varchar(255), `description` varchar(255)) ENGINE=InnoDB DEFAULT CHARSET=utf8
1613
+  (14.0ms) CREATE INDEX `index_applications_on_ancestry` ON `applications` (`ancestry`)
1614
+  (10.0ms) CREATE INDEX `user_id` ON `applications` (`user_id`)
1615
+  (17.0ms) CREATE TABLE `job_data` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `job_id` int(11) DEFAULT 0 NOT NULL, `created_at` datetime, `updated_at` datetime, `data` longtext NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8
1616
+  (10.0ms) CREATE TABLE `job_errors` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `job_id` int(11), `created_at` datetime, `message` longtext, `status` varchar(255), `last_alerted_at` datetime, `updated_at` datetime) ENGINE=InnoDB DEFAULT CHARSET=utf8
1617
+  (10.0ms) CREATE INDEX `job_id` ON `job_errors` (`job_id`)
1618
+  (13.0ms) CREATE TABLE `jobs` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `created_at` datetime, `updated_at` datetime, `name` varchar(255) NOT NULL, `active` tinyint(1) DEFAULT 1 NOT NULL, `last_run` datetime, `cron_expr` varchar(1024) NOT NULL, `status` varchar(255), `user_id` int(11), `alert_keys` text, `deleted_at` datetime, `error_timeout` int(11) DEFAULT 60 NOT NULL, `next_run` datetime, `description` text, `app_id` int(11) NOT NULL, `metrics` text NOT NULL, `monitor_expr` text, `minutes` int(11), `to_date` text) ENGINE=InnoDB DEFAULT CHARSET=utf8
1619
+  (9.0ms) CREATE INDEX `app_id` ON `jobs` (`app_id`)
1620
+  (9.0ms) CREATE UNIQUE INDEX `id_name_version_key` ON `jobs` (`id`, `name`)
1621
+  (9.0ms) CREATE INDEX `jobs_ibfk_1` ON `jobs` (`user_id`)
1622
+  (8.0ms) CREATE TABLE `users` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `created_at` datetime, `updated_at` datetime, `encrypted_password` varchar(255) DEFAULT '' NOT NULL, `email` varchar(255) NOT NULL, `first_name` varchar(255), `last_name` varchar(255), `last_login` datetime, `preferences` text) ENGINE=InnoDB DEFAULT CHARSET=utf8
1623
+  (10.0ms) CREATE UNIQUE INDEX `email` ON `users` (`email`)
1624
+  (10.0ms) CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8
1625
+  (11.0ms) CREATE UNIQUE INDEX `unique_schema_migrations` ON `schema_migrations` (`version`)
1626
+  (1.0ms) SELECT version FROM `schema_migrations`
1627
+  (1.0ms) INSERT INTO `schema_migrations` (version) VALUES ('20131106162900')
1628
+  (10.0ms) DROP DATABASE IF EXISTS `rearview_ruby_test`
1629
+  (7.0ms) CREATE DATABASE `rearview_ruby_test` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`
1630
+  (60.0ms) CREATE TABLE `applications` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `user_id` int(11), `name` varchar(255) NOT NULL, `created_at` datetime, `updated_at` datetime, `deleted_at` datetime, `ancestry` varchar(255), `description` varchar(255)) ENGINE=InnoDB DEFAULT CHARSET=utf8
1631
+  (12.0ms) CREATE INDEX `index_applications_on_ancestry` ON `applications` (`ancestry`)
1632
+  (10.0ms) CREATE INDEX `user_id` ON `applications` (`user_id`)
1633
+  (13.0ms) CREATE TABLE `job_data` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `job_id` int(11) DEFAULT 0 NOT NULL, `created_at` datetime, `updated_at` datetime, `data` longtext NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8
1634
+  (8.0ms) CREATE TABLE `job_errors` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `job_id` int(11), `created_at` datetime, `message` longtext, `status` varchar(255), `last_alerted_at` datetime, `updated_at` datetime) ENGINE=InnoDB DEFAULT CHARSET=utf8
1635
+  (10.0ms) CREATE INDEX `job_id` ON `job_errors` (`job_id`)
1636
+  (12.0ms) CREATE TABLE `jobs` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `created_at` datetime, `updated_at` datetime, `name` varchar(255) NOT NULL, `active` tinyint(1) DEFAULT 1 NOT NULL, `last_run` datetime, `cron_expr` varchar(1024) NOT NULL, `status` varchar(255), `user_id` int(11), `alert_keys` text, `deleted_at` datetime, `error_timeout` int(11) DEFAULT 60 NOT NULL, `next_run` datetime, `description` text, `app_id` int(11) NOT NULL, `metrics` text NOT NULL, `monitor_expr` text, `minutes` int(11), `to_date` text) ENGINE=InnoDB DEFAULT CHARSET=utf8
1637
+  (10.0ms) CREATE INDEX `app_id` ON `jobs` (`app_id`)
1638
+  (14.0ms) CREATE UNIQUE INDEX `id_name_version_key` ON `jobs` (`id`, `name`)
1639
+  (9.0ms) CREATE INDEX `jobs_ibfk_1` ON `jobs` (`user_id`)
1640
+  (10.0ms) CREATE TABLE `users` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `created_at` datetime, `updated_at` datetime, `encrypted_password` varchar(255) DEFAULT '' NOT NULL, `email` varchar(255) NOT NULL, `first_name` varchar(255), `last_name` varchar(255), `last_login` datetime, `preferences` text) ENGINE=InnoDB DEFAULT CHARSET=utf8
1641
+  (8.0ms) CREATE UNIQUE INDEX `email` ON `users` (`email`)
1642
+  (17.0ms) CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8
1643
+  (14.0ms) CREATE UNIQUE INDEX `unique_schema_migrations` ON `schema_migrations` (`version`)
1644
+  (1.0ms) SELECT version FROM `schema_migrations`
1645
+  (2.0ms) INSERT INTO `schema_migrations` (version) VALUES ('20131106162900')