rails-push-notifications 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,69 @@
1
+ module RailsPushNotifications
2
+ describe GCMApp, type: :model do
3
+
4
+ it 'creates an instance given valid attributes' do
5
+ GCMApp.create! attributes_for :gcm_app
6
+ end
7
+
8
+ describe 'validations' do
9
+ let(:app) { build :gcm_app }
10
+
11
+ it 'requires a gcm key' do
12
+ app.gcm_key = nil
13
+ expect(app).to_not be_valid
14
+ end
15
+ end
16
+
17
+ describe 'notifications relationship' do
18
+ let(:app) { create :gcm_app }
19
+
20
+ it 'can create new notifications' do
21
+ expect do
22
+ app.notifications.create attributes_for :gcm_notification
23
+ end.to change { app.reload.notifications.count }.from(0).to 1
24
+ end
25
+ end
26
+
27
+ describe '#push_notifications' do
28
+ let(:app) { create :gcm_app }
29
+ let(:notifications) do
30
+ (1..10).map { create :gcm_notification, app: app }
31
+ end
32
+ let(:single_notification) { create :gcm_notification, app: app }
33
+
34
+ let(:response) { JSON.dump a: 1 }
35
+
36
+ before do
37
+ stub_request(:post, 'https://android.googleapis.com/gcm/send').
38
+ to_return status: [200, 'OK'], body: response
39
+ end
40
+
41
+ it 'assigns results' do
42
+ expect do
43
+ app.push_notifications
44
+ end.to change {
45
+ notifications.map { |n| n.reload.results }
46
+ }.from([nil] * 10).
47
+ to([RubyPushNotifications::GCM::GCMResponse.new(200, response)] * 10)
48
+ end
49
+
50
+ it 'marks as sent' do
51
+ expect do
52
+ app.push_notifications
53
+ end.to change { single_notification.reload.sent }.from(false).to true
54
+ end
55
+
56
+ context 'with an already sent notification' do
57
+ let!(:sent_notification) { create :apns_notification, app: app }
58
+
59
+ before { app.push_notifications }
60
+
61
+ it "doesn't send already sent notifications" do
62
+ expect(RubyPushNotifications::GCM::GCMConnection).
63
+ to_not receive(:post)
64
+ app.push_notifications
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,75 @@
1
+ module RailsPushNotifications
2
+ describe MPNSApp, type: :model do
3
+
4
+ it 'creates an instance given valid attributes' do
5
+ MPNSApp.create! attributes_for :mpns_app
6
+ end
7
+
8
+ describe 'validations' do
9
+
10
+ let(:app) { build :mpns_app }
11
+
12
+ it 'requires the certificate' do
13
+ app.cert = nil
14
+ expect(app).to_not be_valid
15
+ end
16
+ end
17
+
18
+ describe 'notifications relationship' do
19
+
20
+ let(:app) { create :mpns_app }
21
+
22
+ it 'can create new notifications' do
23
+ expect do
24
+ app.notifications.create attributes_for :mpns_notification
25
+ end.to change { app.reload.notifications.count }.from(0).to 1
26
+ end
27
+ end
28
+
29
+ describe '#push_notifications' do
30
+
31
+ let(:app) { create :mpns_app }
32
+ let(:notifications) {
33
+ (1..10).map { create :mpns_notification, app: app }
34
+ }
35
+ let(:single_notification) { create :mpns_notification, app: app }
36
+
37
+ let(:headers) {
38
+ {
39
+ 'x-notificationstatus' => 'Received',
40
+ 'x-deviceconnectionstatus' => 'Connected',
41
+ 'x-subscriptionstatus' => 'Active'
42
+ }
43
+ }
44
+ let(:response) { [ { device_url: 'http://s.notify.live.net/1', headers: headers, code: 200 } ]}
45
+
46
+ before do
47
+ stub_request(:post, %r{s.notify.live.net}).
48
+ to_return status: [200, 'OK'], headers: headers
49
+ end
50
+
51
+ it 'assigns results' do
52
+ expect do
53
+ app.push_notifications
54
+ end.to change { notifications.map { |n| n.reload.results } }.from([nil] * 10).to([RubyPushNotifications::MPNS::MPNSResponse.new(response)] * 10)
55
+ end
56
+
57
+ it 'marks as sent' do
58
+ expect do
59
+ app.push_notifications
60
+ end.to change { single_notification.reload.sent }.from(false).to true
61
+ end
62
+
63
+ context 'with an already sent notification' do
64
+ let!(:sent_notification) { create :mpns_notification, app: app }
65
+
66
+ before { app.push_notifications }
67
+
68
+ it "doesn't send already sent notifications" do
69
+ expect(RubyPushNotifications::MPNS::MPNSConnection).to_not receive(:post)
70
+ app.push_notifications
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,15 @@
1
+ FactoryGirl.define do
2
+ factory :apns_app, class: 'RailsPushNotifications::APNSApp' do
3
+ apns_dev_cert 'abc'
4
+ apns_prod_cert 'def'
5
+ sandbox_mode true
6
+ end
7
+
8
+ factory :gcm_app, class: 'RailsPushNotifications::GCMApp' do
9
+ gcm_key 'abc123def456'
10
+ end
11
+
12
+ factory :mpns_app, class: 'RailsPushNotifications::MPNSApp' do
13
+ cert 'abc'
14
+ end
15
+ end
@@ -0,0 +1,20 @@
1
+
2
+ FactoryGirl.define do
3
+ factory :apns_notification, class: 'RailsPushNotifications::Notification' do
4
+ association :app, factory: :apns_app, strategy: :create
5
+ data a: 1
6
+ destinations ['1']
7
+ end
8
+
9
+ factory :gcm_notification, class: 'RailsPushNotifications::Notification' do
10
+ association :app, factory: :gcm_app, strategy: :create
11
+ data a: 1
12
+ destinations ['1']
13
+ end
14
+
15
+ factory :mpns_notification, class: 'RailsPushNotifications::Notification' do
16
+ association :app, factory: :mpns_app, strategy: :create
17
+ data message: { value1: 'hello' }
18
+ destinations ['http://s.notify.live.net/1']
19
+ end
20
+ end
@@ -0,0 +1,25 @@
1
+ require 'generators/rails-push-notifications/migrations_generator'
2
+
3
+ describe RailsPushNotifications::Generators::MigrationsGenerator, type: :generator do
4
+ destination File.expand_path("../tmp", __FILE__)
5
+
6
+ before do
7
+ prepare_destination
8
+ run_generator
9
+ end
10
+
11
+ after do
12
+ rm_rf destination_root
13
+ end
14
+
15
+ it 'creates the migrations' do
16
+ expect(destination_root).to have_structure do
17
+ directory 'db' do
18
+ directory 'migrate' do
19
+ migration 'create_rails_push_notifications_apps'
20
+ migration 'create_rails_push_notifications_notifications'
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
data/spec/log/test.log ADDED
@@ -0,0 +1,262 @@
1
+  (0.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2
+  (0.1ms) select sqlite_version(*)
3
+  (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
+ ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
5
+ Migrating to CreateRailsPushNotificationsApps (0)
6
+  (0.0ms) begin transaction
7
+  (0.2ms) CREATE TABLE "rails_push_notifications_apns_apps" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "apns_dev_cert" text, "apns_prod_cert" text, "sandbox_mode" boolean, "created_at" datetime, "updated_at" datetime)
8
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "0"]]
9
+  (0.1ms) commit transaction
10
+ Migrating to CreateRpnDevices (1)
11
+  (0.0ms) begin transaction
12
+  (0.2ms) CREATE TABLE "rpn_devices" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "guid" varchar, "config_id" integer, "config_type" varchar, "created_at" datetime, "updated_at" datetime)
13
+  (0.1ms) CREATE INDEX "index_rpn_devices_on_config_id_and_config_type" ON "rpn_devices" ("config_id", "config_type")
14
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "1"]]
15
+  (0.0ms) commit transaction
16
+ Migrating to CreateRpnNotifications (2)
17
+  (0.0ms) begin transaction
18
+  (0.1ms) CREATE TABLE "rpn_notifications" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar, "device_token" varchar, "config_id" integer, "config_type" varchar, "data" text, "error" varchar, "sent_at" datetime, "created_at" datetime, "updated_at" datetime) 
19
+  (0.1ms) CREATE INDEX "index_rpn_notifications_on_type" ON "rpn_notifications" ("type")
20
+  (0.1ms)  SELECT sql
21
+ FROM sqlite_master
22
+ WHERE name='index_rpn_notifications_on_type' AND type='index'
23
+ UNION ALL
24
+ SELECT sql
25
+ FROM sqlite_temp_master
26
+ WHERE name='index_rpn_notifications_on_type' AND type='index'
27
+ 
28
+  (0.1ms) CREATE INDEX "index_rpn_notifications_on_config_id_and_config_type" ON "rpn_notifications" ("config_id", "config_type")
29
+  (0.1ms) CREATE TABLE "rpn_bulk_notifications" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar, "device_tokens" text, "config_id" integer, "config_type" varchar, "data" text, "failed" integer, "succeeded" integer, "sent_at" datetime, "created_at" datetime, "updated_at" datetime) 
30
+  (0.1ms) CREATE INDEX "index_rpn_bulk_notifications_on_type" ON "rpn_bulk_notifications" ("type")
31
+  (0.1ms)  SELECT sql
32
+ FROM sqlite_master
33
+ WHERE name='index_rpn_bulk_notifications_on_type' AND type='index'
34
+ UNION ALL
35
+ SELECT sql
36
+ FROM sqlite_temp_master
37
+ WHERE name='index_rpn_bulk_notifications_on_type' AND type='index'
38
+ 
39
+  (0.1ms) CREATE INDEX "index_rpn_bulk_notifications_on_config_id_and_config_type" ON "rpn_bulk_notifications" ("config_id", "config_type")
40
+ SQL (0.0ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "2"]]
41
+  (0.0ms) commit transaction
42
+  (0.1ms) begin transaction
43
+  (0.1ms) rollback transaction
44
+  (0.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
45
+  (0.0ms) select sqlite_version(*)
46
+  (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
47
+ ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
48
+ Migrating to CreateRailsPushNotificationsApps (0)
49
+  (0.0ms) begin transaction
50
+  (0.2ms) CREATE TABLE "rails_push_notifications_apns_apps" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "apns_dev_cert" text, "apns_prod_cert" text, "sandbox_mode" boolean, "created_at" datetime, "updated_at" datetime)
51
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "0"]]
52
+  (0.1ms) commit transaction
53
+ Migrating to CreateRpnDevices (1)
54
+  (0.0ms) begin transaction
55
+  (0.1ms) CREATE TABLE "rpn_devices" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "guid" varchar, "config_id" integer, "config_type" varchar, "created_at" datetime, "updated_at" datetime)
56
+  (0.1ms) CREATE INDEX "index_rpn_devices_on_config_id_and_config_type" ON "rpn_devices" ("config_id", "config_type")
57
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "1"]]
58
+  (0.0ms) commit transaction
59
+ Migrating to CreateRpnNotifications (2)
60
+  (0.0ms) begin transaction
61
+  (0.1ms) CREATE TABLE "rpn_notifications" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar, "device_token" varchar, "config_id" integer, "config_type" varchar, "data" text, "error" varchar, "sent_at" datetime, "created_at" datetime, "updated_at" datetime) 
62
+  (0.1ms) CREATE INDEX "index_rpn_notifications_on_type" ON "rpn_notifications" ("type")
63
+  (0.1ms)  SELECT sql
64
+ FROM sqlite_master
65
+ WHERE name='index_rpn_notifications_on_type' AND type='index'
66
+ UNION ALL
67
+ SELECT sql
68
+ FROM sqlite_temp_master
69
+ WHERE name='index_rpn_notifications_on_type' AND type='index'
70
+ 
71
+  (0.1ms) CREATE INDEX "index_rpn_notifications_on_config_id_and_config_type" ON "rpn_notifications" ("config_id", "config_type")
72
+  (0.1ms) CREATE TABLE "rpn_bulk_notifications" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar, "device_tokens" text, "config_id" integer, "config_type" varchar, "data" text, "failed" integer, "succeeded" integer, "sent_at" datetime, "created_at" datetime, "updated_at" datetime) 
73
+  (0.1ms) CREATE INDEX "index_rpn_bulk_notifications_on_type" ON "rpn_bulk_notifications" ("type")
74
+  (0.1ms)  SELECT sql
75
+ FROM sqlite_master
76
+ WHERE name='index_rpn_bulk_notifications_on_type' AND type='index'
77
+ UNION ALL
78
+ SELECT sql
79
+ FROM sqlite_temp_master
80
+ WHERE name='index_rpn_bulk_notifications_on_type' AND type='index'
81
+ 
82
+  (0.1ms) CREATE INDEX "index_rpn_bulk_notifications_on_config_id_and_config_type" ON "rpn_bulk_notifications" ("config_id", "config_type")
83
+ SQL (0.0ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "2"]]
84
+  (0.0ms) commit transaction
85
+  (0.1ms) begin transaction
86
+  (0.1ms) rollback transaction
87
+  (0.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
88
+  (0.0ms) select sqlite_version(*)
89
+  (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
90
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
91
+ Migrating to CreateRailsPushNotificationsApps (0)
92
+  (0.0ms) begin transaction
93
+  (0.2ms) CREATE TABLE "rails_push_notifications_apns_apps" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "apns_dev_cert" text, "apns_prod_cert" text, "sandbox_mode" boolean, "created_at" datetime, "updated_at" datetime)
94
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "0"]]
95
+  (0.0ms) commit transaction
96
+ Migrating to CreateRpnDevices (1)
97
+  (0.0ms) begin transaction
98
+  (0.1ms) CREATE TABLE "rpn_devices" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "guid" varchar, "config_id" integer, "config_type" varchar, "created_at" datetime, "updated_at" datetime)
99
+  (0.1ms) CREATE INDEX "index_rpn_devices_on_config_id_and_config_type" ON "rpn_devices" ("config_id", "config_type")
100
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "1"]]
101
+  (0.0ms) commit transaction
102
+ Migrating to CreateRpnNotifications (2)
103
+  (0.0ms) begin transaction
104
+  (0.1ms) CREATE TABLE "rpn_notifications" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar, "device_token" varchar, "config_id" integer, "config_type" varchar, "data" text, "error" varchar, "sent_at" datetime, "created_at" datetime, "updated_at" datetime) 
105
+  (0.1ms) CREATE INDEX "index_rpn_notifications_on_type" ON "rpn_notifications" ("type")
106
+  (0.1ms)  SELECT sql
107
+ FROM sqlite_master
108
+ WHERE name='index_rpn_notifications_on_type' AND type='index'
109
+ UNION ALL
110
+ SELECT sql
111
+ FROM sqlite_temp_master
112
+ WHERE name='index_rpn_notifications_on_type' AND type='index'
113
+ 
114
+  (0.1ms) CREATE INDEX "index_rpn_notifications_on_config_id_and_config_type" ON "rpn_notifications" ("config_id", "config_type")
115
+  (0.1ms) CREATE TABLE "rpn_bulk_notifications" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar, "device_tokens" text, "config_id" integer, "config_type" varchar, "data" text, "failed" integer, "succeeded" integer, "sent_at" datetime, "created_at" datetime, "updated_at" datetime) 
116
+  (0.1ms) CREATE INDEX "index_rpn_bulk_notifications_on_type" ON "rpn_bulk_notifications" ("type")
117
+  (0.1ms)  SELECT sql
118
+ FROM sqlite_master
119
+ WHERE name='index_rpn_bulk_notifications_on_type' AND type='index'
120
+ UNION ALL
121
+ SELECT sql
122
+ FROM sqlite_temp_master
123
+ WHERE name='index_rpn_bulk_notifications_on_type' AND type='index'
124
+ 
125
+  (0.1ms) CREATE INDEX "index_rpn_bulk_notifications_on_config_id_and_config_type" ON "rpn_bulk_notifications" ("config_id", "config_type")
126
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "2"]]
127
+  (0.0ms) commit transaction
128
+  (0.1ms) begin transaction
129
+  (0.1ms) rollback transaction
130
+  (0.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
131
+  (0.0ms) select sqlite_version(*)
132
+  (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
133
+ ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
134
+ Migrating to CreateRailsPushNotificationsApps (0)
135
+  (0.0ms) begin transaction
136
+  (0.2ms) CREATE TABLE "rails_push_notifications_apns_apps" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "apns_dev_cert" text, "apns_prod_cert" text, "sandbox_mode" boolean, "created_at" datetime, "updated_at" datetime)
137
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "0"]]
138
+  (0.0ms) commit transaction
139
+ Migrating to CreateRpnDevices (1)
140
+  (0.0ms) begin transaction
141
+  (0.2ms) CREATE TABLE "rpn_devices" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "guid" varchar, "config_id" integer, "config_type" varchar, "created_at" datetime, "updated_at" datetime)
142
+  (0.1ms) CREATE INDEX "index_rpn_devices_on_config_id_and_config_type" ON "rpn_devices" ("config_id", "config_type")
143
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "1"]]
144
+  (0.0ms) commit transaction
145
+ Migrating to CreateRpnNotifications (2)
146
+  (0.0ms) begin transaction
147
+  (0.1ms) CREATE TABLE "rpn_notifications" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar, "device_token" varchar, "config_id" integer, "config_type" varchar, "data" text, "error" varchar, "sent_at" datetime, "created_at" datetime, "updated_at" datetime) 
148
+  (0.1ms) CREATE INDEX "index_rpn_notifications_on_type" ON "rpn_notifications" ("type")
149
+  (0.1ms)  SELECT sql
150
+ FROM sqlite_master
151
+ WHERE name='index_rpn_notifications_on_type' AND type='index'
152
+ UNION ALL
153
+ SELECT sql
154
+ FROM sqlite_temp_master
155
+ WHERE name='index_rpn_notifications_on_type' AND type='index'
156
+ 
157
+  (0.1ms) CREATE INDEX "index_rpn_notifications_on_config_id_and_config_type" ON "rpn_notifications" ("config_id", "config_type")
158
+  (0.1ms) CREATE TABLE "rpn_bulk_notifications" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar, "device_tokens" text, "config_id" integer, "config_type" varchar, "data" text, "failed" integer, "succeeded" integer, "sent_at" datetime, "created_at" datetime, "updated_at" datetime) 
159
+  (0.1ms) CREATE INDEX "index_rpn_bulk_notifications_on_type" ON "rpn_bulk_notifications" ("type")
160
+  (0.1ms)  SELECT sql
161
+ FROM sqlite_master
162
+ WHERE name='index_rpn_bulk_notifications_on_type' AND type='index'
163
+ UNION ALL
164
+ SELECT sql
165
+ FROM sqlite_temp_master
166
+ WHERE name='index_rpn_bulk_notifications_on_type' AND type='index'
167
+ 
168
+  (0.1ms) CREATE INDEX "index_rpn_bulk_notifications_on_config_id_and_config_type" ON "rpn_bulk_notifications" ("config_id", "config_type")
169
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "2"]]
170
+  (0.0ms) commit transaction
171
+  (0.1ms) begin transaction
172
+  (0.1ms) rollback transaction
173
+  (0.2ms) begin transaction
174
+  (0.1ms) rollback transaction
175
+  (0.2ms) begin transaction
176
+  (0.1ms) rollback transaction
177
+  (0.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
178
+  (0.0ms) select sqlite_version(*)
179
+  (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
180
+ ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
181
+ Migrating to CreateRailsPushNotificationsApps (0)
182
+  (0.1ms) begin transaction
183
+  (0.2ms) CREATE TABLE "rails_push_notifications_apns_apps" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "apns_dev_cert" text, "apns_prod_cert" text, "sandbox_mode" boolean, "created_at" datetime, "updated_at" datetime)
184
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "0"]]
185
+  (0.0ms) commit transaction
186
+ Migrating to CreateRpnDevices (1)
187
+  (0.0ms) begin transaction
188
+  (0.1ms) CREATE TABLE "rpn_devices" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "guid" varchar, "config_id" integer, "config_type" varchar, "created_at" datetime, "updated_at" datetime)
189
+  (0.1ms) CREATE INDEX "index_rpn_devices_on_config_id_and_config_type" ON "rpn_devices" ("config_id", "config_type")
190
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "1"]]
191
+  (0.0ms) commit transaction
192
+ Migrating to CreateRpnNotifications (2)
193
+  (0.0ms) begin transaction
194
+  (0.1ms) CREATE TABLE "rpn_notifications" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar, "device_token" varchar, "config_id" integer, "config_type" varchar, "data" text, "error" varchar, "sent_at" datetime, "created_at" datetime, "updated_at" datetime) 
195
+  (0.1ms) CREATE INDEX "index_rpn_notifications_on_type" ON "rpn_notifications" ("type")
196
+  (0.1ms)  SELECT sql
197
+ FROM sqlite_master
198
+ WHERE name='index_rpn_notifications_on_type' AND type='index'
199
+ UNION ALL
200
+ SELECT sql
201
+ FROM sqlite_temp_master
202
+ WHERE name='index_rpn_notifications_on_type' AND type='index'
203
+ 
204
+  (0.1ms) CREATE INDEX "index_rpn_notifications_on_config_id_and_config_type" ON "rpn_notifications" ("config_id", "config_type")
205
+  (0.1ms) CREATE TABLE "rpn_bulk_notifications" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar, "device_tokens" text, "config_id" integer, "config_type" varchar, "data" text, "failed" integer, "succeeded" integer, "sent_at" datetime, "created_at" datetime, "updated_at" datetime) 
206
+  (0.1ms) CREATE INDEX "index_rpn_bulk_notifications_on_type" ON "rpn_bulk_notifications" ("type")
207
+  (0.1ms)  SELECT sql
208
+ FROM sqlite_master
209
+ WHERE name='index_rpn_bulk_notifications_on_type' AND type='index'
210
+ UNION ALL
211
+ SELECT sql
212
+ FROM sqlite_temp_master
213
+ WHERE name='index_rpn_bulk_notifications_on_type' AND type='index'
214
+ 
215
+  (0.1ms) CREATE INDEX "index_rpn_bulk_notifications_on_config_id_and_config_type" ON "rpn_bulk_notifications" ("config_id", "config_type")
216
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "2"]]
217
+  (0.0ms) commit transaction
218
+  (0.1ms) begin transaction
219
+  (0.1ms) rollback transaction
220
+  (0.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
221
+  (0.0ms) select sqlite_version(*)
222
+  (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
223
+ ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
224
+ Migrating to CreateRailsPushNotificationsApps (0)
225
+  (0.1ms) begin transaction
226
+  (0.2ms) CREATE TABLE "rails_push_notifications_apns_apps" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "apns_dev_cert" text, "apns_prod_cert" text, "sandbox_mode" boolean, "created_at" datetime, "updated_at" datetime)
227
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "0"]]
228
+  (0.0ms) commit transaction
229
+ Migrating to CreateRpnDevices (1)
230
+  (0.0ms) begin transaction
231
+  (0.1ms) CREATE TABLE "rpn_devices" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "guid" varchar, "config_id" integer, "config_type" varchar, "created_at" datetime, "updated_at" datetime)
232
+  (0.1ms) CREATE INDEX "index_rpn_devices_on_config_id_and_config_type" ON "rpn_devices" ("config_id", "config_type")
233
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "1"]]
234
+  (0.0ms) commit transaction
235
+ Migrating to CreateRpnNotifications (2)
236
+  (0.0ms) begin transaction
237
+  (0.3ms) CREATE TABLE "rpn_notifications" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar, "device_token" varchar, "config_id" integer, "config_type" varchar, "data" text, "error" varchar, "sent_at" datetime, "created_at" datetime, "updated_at" datetime) 
238
+  (0.1ms) CREATE INDEX "index_rpn_notifications_on_type" ON "rpn_notifications" ("type")
239
+  (0.1ms)  SELECT sql
240
+ FROM sqlite_master
241
+ WHERE name='index_rpn_notifications_on_type' AND type='index'
242
+ UNION ALL
243
+ SELECT sql
244
+ FROM sqlite_temp_master
245
+ WHERE name='index_rpn_notifications_on_type' AND type='index'
246
+ 
247
+  (0.1ms) CREATE INDEX "index_rpn_notifications_on_config_id_and_config_type" ON "rpn_notifications" ("config_id", "config_type")
248
+  (0.2ms) CREATE TABLE "rpn_bulk_notifications" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar, "device_tokens" text, "config_id" integer, "config_type" varchar, "data" text, "failed" integer, "succeeded" integer, "sent_at" datetime, "created_at" datetime, "updated_at" datetime) 
249
+  (0.1ms) CREATE INDEX "index_rpn_bulk_notifications_on_type" ON "rpn_bulk_notifications" ("type")
250
+  (0.1ms)  SELECT sql
251
+ FROM sqlite_master
252
+ WHERE name='index_rpn_bulk_notifications_on_type' AND type='index'
253
+ UNION ALL
254
+ SELECT sql
255
+ FROM sqlite_temp_master
256
+ WHERE name='index_rpn_bulk_notifications_on_type' AND type='index'
257
+ 
258
+  (0.1ms) CREATE INDEX "index_rpn_bulk_notifications_on_config_id_and_config_type" ON "rpn_bulk_notifications" ("config_id", "config_type")
259
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "2"]]
260
+  (0.0ms) commit transaction
261
+  (0.1ms) begin transaction
262
+  (0.1ms) rollback transaction