notifiable-rails 0.19.9 → 0.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -11
- data/app/controllers/notifiable/device_tokens_controller.rb +1 -1
- data/{lib/generators/notifiable/install/templates/create_notifiable_apps.rb → db/migrate/20131210115648_create_notifiable_apps.rb} +0 -0
- data/{lib/generators/notifiable/install/templates/create_notifiable_device_tokens.rb → db/migrate/20131210115649_create_notifiable_device_tokens.rb} +0 -0
- data/{lib/generators/notifiable/install/templates/create_notifiable_notifications.rb → db/migrate/20131210115650_create_notifiable_notifications.rb} +0 -0
- data/{lib/generators/notifiable/install/templates/create_notifiable_statuses.rb → db/migrate/20131210115651_create_notifiable_statuses.rb} +0 -0
- data/lib/notifiable/engine.rb +10 -0
- data/lib/notifiable/version.rb +1 -1
- data/spec/controllers/device_tokens_controller_spec.rb +114 -105
- data/spec/controllers/notifications_controller_spec.rb +45 -45
- data/spec/model/notifiable_app_spec.rb +25 -0
- data/spec/model/notifiable_spec.rb +25 -0
- data/spec/model/notification_spec.rb +105 -0
- data/spec/model/notifier_base_spec.rb +18 -0
- data/spec/spec_helper.rb +15 -1
- data/spec/test_app/app/controllers/application_controller.rb +2 -0
- data/spec/test_app/config/database.yml +6 -0
- data/spec/test_app/db/development.sqlite3 +0 -0
- data/spec/test_app/db/migrate/{20131210115648_create_users.rb → 20131210115652_create_users.rb} +0 -0
- data/spec/test_app/db/schema.rb +2 -2
- data/spec/test_app/db/test.sqlite3 +0 -0
- data/spec/test_app/log/development.log +186 -0
- data/spec/test_app/log/test.log +33197 -0
- metadata +48 -70
- data/spec/notifiable_app_spec.rb +0 -24
- data/spec/notifiable_spec.rb +0 -20
- data/spec/notification_spec.rb +0 -119
- data/spec/notifier_base_spec.rb +0 -27
- data/spec/test_app/db/migrate/20131210115649_create_notifiable_apps.rb +0 -10
- data/spec/test_app/db/migrate/20131228225139_create_notifiable_device_tokens.rb +0 -18
- data/spec/test_app/db/migrate/20131228225140_create_notifiable_notifications.rb +0 -26
- data/spec/test_app/db/migrate/20131229104039_create_notifiable_statuses.rb +0 -12
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Notifiable::App do
|
4
|
+
describe "#notifications" do
|
5
|
+
subject(:notifiable_app) { create(:app) }
|
6
|
+
let!(:notification) { create(:notification, :app => notifiable_app) }
|
7
|
+
|
8
|
+
it { expect(notification.app).to_not be_nil }
|
9
|
+
it { expect(notifiable_app.notifications.count).to eq 1 }
|
10
|
+
end
|
11
|
+
|
12
|
+
describe "#configure" do
|
13
|
+
let(:notification) { create(:notification, :app => notifiable_app) }
|
14
|
+
let(:notifier) { ConfigurableMockNotifier.new(Rails.env, notification) }
|
15
|
+
subject(:notifiable_app) { create(:app, :configuration => {:configurable_mock => {:use_sandbox => true}}) }
|
16
|
+
|
17
|
+
before(:each) { notifiable_app.configure :configurable_mock, notifier }
|
18
|
+
|
19
|
+
it { expect(notifier.use_sandbox).to eq true }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
class ConfigurableMockNotifier < Notifiable::NotifierBase
|
24
|
+
attr_accessor :use_sandbox
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Notifiable::Concern do
|
4
|
+
|
5
|
+
describe "#send_notification" do
|
6
|
+
|
7
|
+
context "single" do
|
8
|
+
let(:user1) { create(:user_with_mock_token) }
|
9
|
+
let(:notification1) { create(:notification, :message => "First test message")}
|
10
|
+
|
11
|
+
before(:each) { user1.send_notification(notification1) }
|
12
|
+
|
13
|
+
it { expect(Notifiable::NotificationStatus.count).to eq 1 }
|
14
|
+
end
|
15
|
+
|
16
|
+
context "invalid device" do
|
17
|
+
let(:user1) { FactoryGirl.create(:user_with_invalid_mock_token) }
|
18
|
+
let(:notification1) { create(:notification, :message => "First test message")}
|
19
|
+
|
20
|
+
before(:each) { user1.send_notification(notification1) }
|
21
|
+
|
22
|
+
it { expect(Notifiable::NotificationStatus.count).to eq 0 }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,105 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Notifiable::Notification do
|
4
|
+
|
5
|
+
let(:user1) { FactoryGirl.create(:user_with_mock_token) }
|
6
|
+
let(:user2) { FactoryGirl.create(:user_with_mock_token) }
|
7
|
+
let(:notification1) { FactoryGirl.create(:notification, :message => "First test message")}
|
8
|
+
let(:notification2) { FactoryGirl.create(:notification, :message => "Second test message")}
|
9
|
+
|
10
|
+
describe "#message" do
|
11
|
+
subject!(:n) { create(:notification, :message => "Test message") }
|
12
|
+
|
13
|
+
it { expect(Notifiable::Notification.first.message).to eq "Test message" }
|
14
|
+
end
|
15
|
+
|
16
|
+
describe "#params" do
|
17
|
+
subject!(:n) { create(:notification, :params => {:custom_property => "A different message"}) }
|
18
|
+
|
19
|
+
it { expect(Notifiable::Notification.first.params).to eq({:custom_property => "A different message"}) }
|
20
|
+
end
|
21
|
+
|
22
|
+
describe "#destroy" do
|
23
|
+
subject(:n) { create(:notification) }
|
24
|
+
let!(:s) { create(:notification_status, :notification => n) }
|
25
|
+
|
26
|
+
before(:each) { n.destroy }
|
27
|
+
|
28
|
+
it { expect(Notifiable::NotificationStatus.count).to eq 0 }
|
29
|
+
end
|
30
|
+
|
31
|
+
describe "#add_notifiable" do
|
32
|
+
context "for a single user" do
|
33
|
+
subject(:notification) { create(:notification) }
|
34
|
+
let(:u) { create(:user_with_mock_token) }
|
35
|
+
|
36
|
+
before(:each) do
|
37
|
+
notification1.batch do |n|
|
38
|
+
n.add_notifiable(u)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
it { expect(Notifiable::Notification.first.sent_count).to eq 1 }
|
43
|
+
it { expect(Notifiable::Notification.first.gateway_accepted_count).to eq 1 }
|
44
|
+
it { expect(Notifiable::Notification.first.opened_count).to eq 0 }
|
45
|
+
it { expect(Notifiable::NotificationStatus.count).to eq 1 }
|
46
|
+
it { expect(Notifiable::NotificationStatus.first.status).to eq 0 }
|
47
|
+
it { expect(Notifiable::NotificationStatus.first.created_at).to_not be_nil }
|
48
|
+
end
|
49
|
+
|
50
|
+
context "for two users" do
|
51
|
+
subject(:notification) { create(:notification) }
|
52
|
+
let(:u1) { create(:user_with_mock_token) }
|
53
|
+
let(:u2) { create(:user_with_mock_token) }
|
54
|
+
|
55
|
+
before(:each) do
|
56
|
+
notification1.batch do |n|
|
57
|
+
n.add_notifiable(u1)
|
58
|
+
n.add_notifiable(u2)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
it { expect(Notifiable::Notification.first.sent_count).to eq 2 }
|
63
|
+
it { expect(Notifiable::Notification.first.gateway_accepted_count).to eq 2 }
|
64
|
+
it { expect(Notifiable::Notification.first.opened_count).to eq 0 }
|
65
|
+
it { expect(Notifiable::NotificationStatus.count).to eq 2 }
|
66
|
+
it { expect(Notifiable::NotificationStatus.first.status).to eq 0 }
|
67
|
+
it { expect(Notifiable::NotificationStatus.first.created_at).to_not be_nil }
|
68
|
+
it { expect(Notifiable::NotificationStatus.last.status).to eq 0 }
|
69
|
+
it { expect(Notifiable::NotificationStatus.last.created_at).to_not be_nil }
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
|
74
|
+
describe "#add_device_token" do
|
75
|
+
context "single token" do
|
76
|
+
subject(:n) { create(:notification) }
|
77
|
+
let(:dt) { create(:mock_token) }
|
78
|
+
|
79
|
+
before(:each) { notification1.batch {|n| n.add_device_token(dt) } }
|
80
|
+
|
81
|
+
it { expect(Notifiable::Notification.first.sent_count).to eq 1 }
|
82
|
+
it { expect(Notifiable::Notification.first.gateway_accepted_count).to eq 1 }
|
83
|
+
it { expect(Notifiable::Notification.first.opened_count).to eq 0 }
|
84
|
+
it { expect(Notifiable::NotificationStatus.count).to eq 1 }
|
85
|
+
it { expect(Notifiable::NotificationStatus.first.status).to eq 0 }
|
86
|
+
it { expect(Notifiable::NotificationStatus.first.created_at).to_not be_nil }
|
87
|
+
end
|
88
|
+
|
89
|
+
context "undefined provider" do
|
90
|
+
subject(:n) { create(:notification) }
|
91
|
+
let(:dt) { create(:mock_token, :provider => :sms) }
|
92
|
+
|
93
|
+
before(:each) do
|
94
|
+
notification1.batch do |n|
|
95
|
+
begin
|
96
|
+
n.add_device_token(unconfigured_device_token)
|
97
|
+
rescue
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
it { expect(Notifiable::NotificationStatus.count).to eq 0 }
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Notifiable::NotifierBase do
|
4
|
+
|
5
|
+
describe "#test_env?" do
|
6
|
+
let(:notifiable_app) { FactoryGirl.create(:app, :configuration => {:configurable_mock => {:use_sandbox => true}}) }
|
7
|
+
let(:notification) { FactoryGirl.create(:notification, :app => notifiable_app) }
|
8
|
+
subject(:notifier) { ConfigurableMockNotifier.new(Rails.env, notification) }
|
9
|
+
|
10
|
+
before(:each) { ConfigurableMockNotifier.send(:public, *ConfigurableMockNotifier.protected_instance_methods) }
|
11
|
+
|
12
|
+
it { expect(notifier.test_env?).to eq true }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
class ConfigurableMockNotifier < Notifiable::NotifierBase
|
17
|
+
attr_accessor :use_sandbox
|
18
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -14,7 +14,6 @@ require File.expand_path("../../lib/notifiable", __FILE__)
|
|
14
14
|
require File.expand_path("../../app/controllers/notifiable/device_tokens_controller", __FILE__)
|
15
15
|
require 'database_cleaner'
|
16
16
|
require 'rspec/rails'
|
17
|
-
require 'rspec/autorun'
|
18
17
|
require 'factory_girl_rails'
|
19
18
|
|
20
19
|
Rails.backtrace_cleaner.remove_silencers!
|
@@ -23,14 +22,29 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
|
23
22
|
|
24
23
|
DatabaseCleaner.strategy = :truncation
|
25
24
|
|
25
|
+
ActiveRecord::Migrator.migrate(File.join(Rails.root, 'db/migrate'))
|
26
|
+
|
26
27
|
RSpec.configure do |config|
|
27
28
|
config.mock_with :rspec
|
28
29
|
config.use_transactional_fixtures = true
|
29
30
|
config.infer_base_class_for_anonymous_controllers = false
|
30
31
|
config.order = "random"
|
32
|
+
|
33
|
+
# For testing engines
|
31
34
|
config.include EngineControllerTestMonkeyPatch, :type => :controller
|
35
|
+
|
36
|
+
# JsonHelpers for controllers
|
32
37
|
config.include Requests::JsonHelpers, :type => :controller
|
33
38
|
|
39
|
+
# Remove need for factory girl prefix
|
40
|
+
config.include FactoryGirl::Syntax::Methods
|
41
|
+
|
42
|
+
# errors for deprecations
|
43
|
+
#config.raise_errors_for_deprecations!
|
44
|
+
|
45
|
+
# Infer the spec type from the containing folder
|
46
|
+
config.infer_spec_type_from_file_location!
|
47
|
+
|
34
48
|
config.before(:each) {
|
35
49
|
DatabaseCleaner.start
|
36
50
|
Notifiable.delivery_method = :send
|
Binary file
|
data/spec/test_app/db/migrate/{20131210115648_create_users.rb → 20131210115652_create_users.rb}
RENAMED
File without changes
|
data/spec/test_app/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 20131210115652) do
|
15
15
|
|
16
16
|
create_table "notifiable_apps", force: true do |t|
|
17
17
|
t.string "name"
|
@@ -30,7 +30,7 @@ ActiveRecord::Schema.define(version: 20131229104039) do
|
|
30
30
|
t.datetime "updated_at"
|
31
31
|
end
|
32
32
|
|
33
|
-
add_index "notifiable_device_tokens", ["token"], name: "index_notifiable_device_tokens_on_token"
|
33
|
+
add_index "notifiable_device_tokens", ["token"], name: "index_notifiable_device_tokens_on_token", unique: true
|
34
34
|
add_index "notifiable_device_tokens", ["user_id"], name: "index_notifiable_device_tokens_on_user_id"
|
35
35
|
|
36
36
|
create_table "notifiable_notifications", force: true do |t|
|
Binary file
|
@@ -1646567,3 +1646567,189 @@ Could not log "sql.active_record" event. Interrupt: ["/Users/matt/.rvm/gems/rub
|
|
1646567
1646567
|
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
1646568
1646568
|
[1m[35mSQL (0.7ms)[0m DELETE FROM "notifiable_notifications" WHERE "notifiable_notifications"."id" = $1 [["id", 6]]
|
1646569
1646569
|
[1m[36m (0.5ms)[0m [1mCOMMIT[0m
|
1646570
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.5ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1646571
|
+
[1m[36m (1.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
1646572
|
+
[1m[35m (0.7ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
1646573
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1646574
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1646575
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1646576
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1646577
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1646578
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1646579
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1646580
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1646581
|
+
[1m[36m (7.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
1646582
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
1646583
|
+
[1m[36m (1.0ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
1646584
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
1646585
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1646586
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1646587
|
+
[1m[36m (7.6ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
1646588
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
1646589
|
+
[1m[36m (1.0ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
1646590
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
1646591
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1646592
|
+
Migrating to CreateNotifiableApps (20131210115648)
|
1646593
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1646594
|
+
[1m[36m (0.4ms)[0m [1mCREATE TABLE "notifiable_apps" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "configuration" text, "created_at" datetime, "updated_at" datetime) [0m
|
1646595
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131210115648"]]
|
1646596
|
+
[1m[36m (0.8ms)[0m [1mcommit transaction[0m
|
1646597
|
+
Migrating to CreateNotifiableDeviceTokens (20131210115649)
|
1646598
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1646599
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "notifiable_device_tokens" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "token" varchar(255), "provider" varchar(255), "is_valid" boolean DEFAULT 't', "user_id" integer, "app_id" integer, "created_at" datetime, "updated_at" datetime) [0m
|
1646600
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
1646601
|
+
[1m[36m (0.7ms)[0m [1mCREATE UNIQUE INDEX "index_notifiable_device_tokens_on_token" ON "notifiable_device_tokens" ("token")[0m
|
1646602
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
1646603
|
+
FROM sqlite_master
|
1646604
|
+
WHERE name='index_notifiable_device_tokens_on_token' AND type='index'
|
1646605
|
+
UNION ALL
|
1646606
|
+
SELECT sql
|
1646607
|
+
FROM sqlite_temp_master
|
1646608
|
+
WHERE name='index_notifiable_device_tokens_on_token' AND type='index'
|
1646609
|
+
|
1646610
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "index_notifiable_device_tokens_on_user_id" ON "notifiable_device_tokens" ("user_id")[0m
|
1646611
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131210115649"]]
|
1646612
|
+
[1m[36m (1.0ms)[0m [1mcommit transaction[0m
|
1646613
|
+
Migrating to CreateNotifiableNotifications (20131210115650)
|
1646614
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1646615
|
+
[1m[36m (0.2ms)[0m [1mCREATE TABLE "notifiable_notifications" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "message" text, "params" text, "app_id" integer, "sent_count" integer DEFAULT 0, "gateway_accepted_count" integer DEFAULT 0, "opened_count" integer DEFAULT 0, "created_at" datetime, "updated_at" datetime) [0m
|
1646616
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131210115650"]]
|
1646617
|
+
[1m[36m (0.7ms)[0m [1mcommit transaction[0m
|
1646618
|
+
Migrating to CreateNotifiableStatuses (20131210115651)
|
1646619
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1646620
|
+
[1m[36m (0.2ms)[0m [1mCREATE TABLE "notifiable_statuses" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "notification_id" integer, "device_token_id" integer, "status" integer, "created_at" datetime) [0m
|
1646621
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131210115651"]]
|
1646622
|
+
[1m[36m (0.7ms)[0m [1mcommit transaction[0m
|
1646623
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
1646624
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
1646625
|
+
FROM sqlite_master
|
1646626
|
+
WHERE name='index_notifiable_device_tokens_on_user_id' AND type='index'
|
1646627
|
+
UNION ALL
|
1646628
|
+
SELECT sql
|
1646629
|
+
FROM sqlite_temp_master
|
1646630
|
+
WHERE name='index_notifiable_device_tokens_on_user_id' AND type='index'
|
1646631
|
+
[0m
|
1646632
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
1646633
|
+
FROM sqlite_master
|
1646634
|
+
WHERE name='index_notifiable_device_tokens_on_token' AND type='index'
|
1646635
|
+
UNION ALL
|
1646636
|
+
SELECT sql
|
1646637
|
+
FROM sqlite_temp_master
|
1646638
|
+
WHERE name='index_notifiable_device_tokens_on_token' AND type='index'
|
1646639
|
+
|
1646640
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1646641
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
1646642
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
1646643
|
+
FROM sqlite_master
|
1646644
|
+
WHERE name='index_notifiable_device_tokens_on_user_id' AND type='index'
|
1646645
|
+
UNION ALL
|
1646646
|
+
SELECT sql
|
1646647
|
+
FROM sqlite_temp_master
|
1646648
|
+
WHERE name='index_notifiable_device_tokens_on_user_id' AND type='index'
|
1646649
|
+
[0m
|
1646650
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
1646651
|
+
FROM sqlite_master
|
1646652
|
+
WHERE name='index_notifiable_device_tokens_on_token' AND type='index'
|
1646653
|
+
UNION ALL
|
1646654
|
+
SELECT sql
|
1646655
|
+
FROM sqlite_temp_master
|
1646656
|
+
WHERE name='index_notifiable_device_tokens_on_token' AND type='index'
|
1646657
|
+
|
1646658
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1646659
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
1646660
|
+
FROM sqlite_master
|
1646661
|
+
WHERE name='index_notifiable_device_tokens_on_user_id' AND type='index'
|
1646662
|
+
UNION ALL
|
1646663
|
+
SELECT sql
|
1646664
|
+
FROM sqlite_temp_master
|
1646665
|
+
WHERE name='index_notifiable_device_tokens_on_user_id' AND type='index'
|
1646666
|
+
|
1646667
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
1646668
|
+
FROM sqlite_master
|
1646669
|
+
WHERE name='index_notifiable_device_tokens_on_token' AND type='index'
|
1646670
|
+
UNION ALL
|
1646671
|
+
SELECT sql
|
1646672
|
+
FROM sqlite_temp_master
|
1646673
|
+
WHERE name='index_notifiable_device_tokens_on_token' AND type='index'
|
1646674
|
+
[0m
|
1646675
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1646676
|
+
Migrating to CreateUsers (20131210115652)
|
1646677
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1646678
|
+
[1m[36m (0.4ms)[0m [1mCREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL) [0m
|
1646679
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131210115652"]]
|
1646680
|
+
[1m[36m (1.9ms)[0m [1mcommit transaction[0m
|
1646681
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
1646682
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
1646683
|
+
FROM sqlite_master
|
1646684
|
+
WHERE name='index_notifiable_device_tokens_on_user_id' AND type='index'
|
1646685
|
+
UNION ALL
|
1646686
|
+
SELECT sql
|
1646687
|
+
FROM sqlite_temp_master
|
1646688
|
+
WHERE name='index_notifiable_device_tokens_on_user_id' AND type='index'
|
1646689
|
+
[0m
|
1646690
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
1646691
|
+
FROM sqlite_master
|
1646692
|
+
WHERE name='index_notifiable_device_tokens_on_token' AND type='index'
|
1646693
|
+
UNION ALL
|
1646694
|
+
SELECT sql
|
1646695
|
+
FROM sqlite_temp_master
|
1646696
|
+
WHERE name='index_notifiable_device_tokens_on_token' AND type='index'
|
1646697
|
+
|
1646698
|
+
[1m[36mUser Load (0.1ms)[0m [1mSELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1[0m
|
1646699
|
+
[1m[35mNotifiable::DeviceToken Load (0.2ms)[0m SELECT "notifiable_device_tokens".* FROM "notifiable_device_tokens"
|
1646700
|
+
[1m[36m (7.4ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
1646701
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
1646702
|
+
[1m[36m (1.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
1646703
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
1646704
|
+
Migrating to CreateNotifiableApps (20131210115648)
|
1646705
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1646706
|
+
[1m[35m (0.4ms)[0m CREATE TABLE "notifiable_apps" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "configuration" text, "created_at" datetime, "updated_at" datetime)
|
1646707
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20131210115648"]]
|
1646708
|
+
[1m[35m (0.8ms)[0m commit transaction
|
1646709
|
+
Migrating to CreateNotifiableDeviceTokens (20131210115649)
|
1646710
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1646711
|
+
[1m[35m (0.4ms)[0m CREATE TABLE "notifiable_device_tokens" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "token" varchar(255), "provider" varchar(255), "is_valid" boolean DEFAULT 't', "user_id" integer, "app_id" integer, "created_at" datetime, "updated_at" datetime)
|
1646712
|
+
[1m[36m (0.8ms)[0m [1mCREATE UNIQUE INDEX "index_notifiable_device_tokens_on_token" ON "notifiable_device_tokens" ("token")[0m
|
1646713
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
1646714
|
+
FROM sqlite_master
|
1646715
|
+
WHERE name='index_notifiable_device_tokens_on_token' AND type='index'
|
1646716
|
+
UNION ALL
|
1646717
|
+
SELECT sql
|
1646718
|
+
FROM sqlite_temp_master
|
1646719
|
+
WHERE name='index_notifiable_device_tokens_on_token' AND type='index'
|
1646720
|
+
|
1646721
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "index_notifiable_device_tokens_on_user_id" ON "notifiable_device_tokens" ("user_id")[0m
|
1646722
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131210115649"]]
|
1646723
|
+
[1m[36m (0.7ms)[0m [1mcommit transaction[0m
|
1646724
|
+
Migrating to CreateNotifiableNotifications (20131210115650)
|
1646725
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1646726
|
+
[1m[36m (0.2ms)[0m [1mCREATE TABLE "notifiable_notifications" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "message" text, "params" text, "app_id" integer, "sent_count" integer DEFAULT 0, "gateway_accepted_count" integer DEFAULT 0, "opened_count" integer DEFAULT 0, "created_at" datetime, "updated_at" datetime) [0m
|
1646727
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131210115650"]]
|
1646728
|
+
[1m[36m (0.6ms)[0m [1mcommit transaction[0m
|
1646729
|
+
Migrating to CreateNotifiableStatuses (20131210115651)
|
1646730
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1646731
|
+
[1m[36m (0.2ms)[0m [1mCREATE TABLE "notifiable_statuses" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "notification_id" integer, "device_token_id" integer, "status" integer, "created_at" datetime) [0m
|
1646732
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131210115651"]]
|
1646733
|
+
[1m[36m (0.5ms)[0m [1mcommit transaction[0m
|
1646734
|
+
Migrating to CreateUsers (20131210115652)
|
1646735
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1646736
|
+
[1m[36m (0.2ms)[0m [1mCREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL) [0m
|
1646737
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131210115652"]]
|
1646738
|
+
[1m[36m (0.6ms)[0m [1mcommit transaction[0m
|
1646739
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
1646740
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
1646741
|
+
FROM sqlite_master
|
1646742
|
+
WHERE name='index_notifiable_device_tokens_on_user_id' AND type='index'
|
1646743
|
+
UNION ALL
|
1646744
|
+
SELECT sql
|
1646745
|
+
FROM sqlite_temp_master
|
1646746
|
+
WHERE name='index_notifiable_device_tokens_on_user_id' AND type='index'
|
1646747
|
+
[0m
|
1646748
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
1646749
|
+
FROM sqlite_master
|
1646750
|
+
WHERE name='index_notifiable_device_tokens_on_token' AND type='index'
|
1646751
|
+
UNION ALL
|
1646752
|
+
SELECT sql
|
1646753
|
+
FROM sqlite_temp_master
|
1646754
|
+
WHERE name='index_notifiable_device_tokens_on_token' AND type='index'
|
1646755
|
+
|