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.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -11
  3. data/app/controllers/notifiable/device_tokens_controller.rb +1 -1
  4. data/{lib/generators/notifiable/install/templates/create_notifiable_apps.rb → db/migrate/20131210115648_create_notifiable_apps.rb} +0 -0
  5. data/{lib/generators/notifiable/install/templates/create_notifiable_device_tokens.rb → db/migrate/20131210115649_create_notifiable_device_tokens.rb} +0 -0
  6. data/{lib/generators/notifiable/install/templates/create_notifiable_notifications.rb → db/migrate/20131210115650_create_notifiable_notifications.rb} +0 -0
  7. data/{lib/generators/notifiable/install/templates/create_notifiable_statuses.rb → db/migrate/20131210115651_create_notifiable_statuses.rb} +0 -0
  8. data/lib/notifiable/engine.rb +10 -0
  9. data/lib/notifiable/version.rb +1 -1
  10. data/spec/controllers/device_tokens_controller_spec.rb +114 -105
  11. data/spec/controllers/notifications_controller_spec.rb +45 -45
  12. data/spec/model/notifiable_app_spec.rb +25 -0
  13. data/spec/model/notifiable_spec.rb +25 -0
  14. data/spec/model/notification_spec.rb +105 -0
  15. data/spec/model/notifier_base_spec.rb +18 -0
  16. data/spec/spec_helper.rb +15 -1
  17. data/spec/test_app/app/controllers/application_controller.rb +2 -0
  18. data/spec/test_app/config/database.yml +6 -0
  19. data/spec/test_app/db/development.sqlite3 +0 -0
  20. data/spec/test_app/db/migrate/{20131210115648_create_users.rb → 20131210115652_create_users.rb} +0 -0
  21. data/spec/test_app/db/schema.rb +2 -2
  22. data/spec/test_app/db/test.sqlite3 +0 -0
  23. data/spec/test_app/log/development.log +186 -0
  24. data/spec/test_app/log/test.log +33197 -0
  25. metadata +48 -70
  26. data/spec/notifiable_app_spec.rb +0 -24
  27. data/spec/notifiable_spec.rb +0 -20
  28. data/spec/notification_spec.rb +0 -119
  29. data/spec/notifier_base_spec.rb +0 -27
  30. data/spec/test_app/db/migrate/20131210115649_create_notifiable_apps.rb +0 -10
  31. data/spec/test_app/db/migrate/20131228225139_create_notifiable_device_tokens.rb +0 -18
  32. data/spec/test_app/db/migrate/20131228225140_create_notifiable_notifications.rb +0 -26
  33. 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
@@ -1,5 +1,7 @@
1
1
  class ApplicationController < ActionController::Base
2
2
 
3
+ include ActionController::MimeResponds
4
+
3
5
  respond_to :json
4
6
 
5
7
  def current_notifiable_user
@@ -26,5 +26,11 @@ test:
26
26
  database: db/test.sqlite3
27
27
  pool: 5
28
28
  timeout: 5000
29
+
30
+ development:
31
+ adapter: sqlite3
32
+ database: db/development.sqlite3
33
+ pool: 5
34
+ timeout: 5000
29
35
 
30
36
 
Binary file
@@ -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: 20131229104039) do
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
   (0.2ms) BEGIN
1646568
1646568
  SQL (0.7ms) DELETE FROM "notifiable_notifications" WHERE "notifiable_notifications"."id" = $1 [["id", 6]]
1646569
1646569
   (0.5ms) COMMIT
1646570
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
1646571
+  (1.2ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
1646572
+  (0.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
1646573
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1646574
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1646575
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1646576
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1646577
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1646578
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1646579
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1646580
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1646581
+  (7.2ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
1646582
+  (0.1ms) select sqlite_version(*)
1646583
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
1646584
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1646585
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1646586
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1646587
+  (7.6ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
1646588
+  (0.1ms) select sqlite_version(*)
1646589
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
1646590
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1646591
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1646592
+ Migrating to CreateNotifiableApps (20131210115648)
1646593
+  (0.1ms) begin transaction
1646594
+  (0.4ms) CREATE TABLE "notifiable_apps" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "configuration" text, "created_at" datetime, "updated_at" datetime) 
1646595
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131210115648"]]
1646596
+  (0.8ms) commit transaction
1646597
+ Migrating to CreateNotifiableDeviceTokens (20131210115649)
1646598
+  (0.0ms) begin transaction
1646599
+  (0.3ms) 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) 
1646600
+  (0.1ms) select sqlite_version(*)
1646601
+  (0.7ms) CREATE UNIQUE INDEX "index_notifiable_device_tokens_on_token" ON "notifiable_device_tokens" ("token")
1646602
+  (0.1ms) 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
+  (0.1ms) CREATE INDEX "index_notifiable_device_tokens_on_user_id" ON "notifiable_device_tokens" ("user_id")
1646611
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131210115649"]]
1646612
+  (1.0ms) commit transaction
1646613
+ Migrating to CreateNotifiableNotifications (20131210115650)
1646614
+  (0.0ms) begin transaction
1646615
+  (0.2ms) CREATE 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) 
1646616
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131210115650"]]
1646617
+  (0.7ms) commit transaction
1646618
+ Migrating to CreateNotifiableStatuses (20131210115651)
1646619
+  (0.0ms) begin transaction
1646620
+  (0.2ms) CREATE TABLE "notifiable_statuses" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "notification_id" integer, "device_token_id" integer, "status" integer, "created_at" datetime) 
1646621
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131210115651"]]
1646622
+  (0.7ms) commit transaction
1646623
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1646624
+  (0.1ms)  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
+ 
1646632
+  (0.1ms) 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
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1646641
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1646642
+  (0.1ms)  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
+ 
1646650
+  (0.1ms) 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
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1646659
+  (0.1ms) 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
+  (0.1ms)  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
+ 
1646675
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1646676
+ Migrating to CreateUsers (20131210115652)
1646677
+  (0.0ms) begin transaction
1646678
+  (0.4ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL) 
1646679
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131210115652"]]
1646680
+  (1.9ms) commit transaction
1646681
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1646682
+  (0.1ms)  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
+ 
1646690
+  (0.1ms) 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
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1
1646699
+ Notifiable::DeviceToken Load (0.2ms) SELECT "notifiable_device_tokens".* FROM "notifiable_device_tokens"
1646700
+  (7.4ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
1646701
+  (0.1ms) select sqlite_version(*)
1646702
+  (1.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
1646703
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1646704
+ Migrating to CreateNotifiableApps (20131210115648)
1646705
+  (0.1ms) begin transaction
1646706
+  (0.4ms) CREATE TABLE "notifiable_apps" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "configuration" text, "created_at" datetime, "updated_at" datetime)
1646707
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131210115648"]]
1646708
+  (0.8ms) commit transaction
1646709
+ Migrating to CreateNotifiableDeviceTokens (20131210115649)
1646710
+  (0.1ms) begin transaction
1646711
+  (0.4ms) 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
+  (0.8ms) CREATE UNIQUE INDEX "index_notifiable_device_tokens_on_token" ON "notifiable_device_tokens" ("token")
1646713
+  (0.1ms) 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
+  (0.1ms) CREATE INDEX "index_notifiable_device_tokens_on_user_id" ON "notifiable_device_tokens" ("user_id")
1646722
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131210115649"]]
1646723
+  (0.7ms) commit transaction
1646724
+ Migrating to CreateNotifiableNotifications (20131210115650)
1646725
+  (0.0ms) begin transaction
1646726
+  (0.2ms) CREATE 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) 
1646727
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131210115650"]]
1646728
+  (0.6ms) commit transaction
1646729
+ Migrating to CreateNotifiableStatuses (20131210115651)
1646730
+  (0.0ms) begin transaction
1646731
+  (0.2ms) CREATE TABLE "notifiable_statuses" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "notification_id" integer, "device_token_id" integer, "status" integer, "created_at" datetime) 
1646732
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131210115651"]]
1646733
+  (0.5ms) commit transaction
1646734
+ Migrating to CreateUsers (20131210115652)
1646735
+  (0.0ms) begin transaction
1646736
+  (0.2ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL) 
1646737
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131210115652"]]
1646738
+  (0.6ms) commit transaction
1646739
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1646740
+  (0.1ms)  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
+ 
1646748
+  (0.1ms) 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
+