payola-payments 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b2a7c6f5a705f5ca63d32cd742c0f48395824dfa
4
- data.tar.gz: e8ad0150b6f8fd8c7461acc430f510f09f632cb6
3
+ metadata.gz: da062cfaa1e4e85c2bbe6600f8a8fc08ca4b0fc7
4
+ data.tar.gz: 64ea3635aa77b25f4d4cd7e318bf33b2152c296c
5
5
  SHA512:
6
- metadata.gz: 9f6c8899ae7651a5d961ea60d8fd7144619f1e393c988f0c4b3be450f76adc5d4130a000203d8e8effc4557958c94ccce022e9ebcabaea5848ee2e7b3ddbd36f
7
- data.tar.gz: 6fe28e17a7d16690ee5ea14290033af67899496fc85f56c6abf65a8f462fab7f44b0960125db5acf809aa889e9ee7447d3ffff19347b6c90a37aad625f9d5e46
6
+ metadata.gz: 13283b2a06f0483039872a787eaf12c001c10cdf1f039a0c0bd89247dcbf5d49411b2c74caa3de4e09f2ba5b58b2599e43f1f22cd73a7d0391d7435b513d4ea1
7
+ data.tar.gz: dad67bb57228c070eac50b2402b6e011ac688fa9d7fbb5fd0d2ba805a36f2d3014f2f3d884f739abdd50326a0437a25f5fb0d7709bedf7ac78676e09c5ccc601
@@ -44,7 +44,7 @@ var PayolaSubscriptionCheckout = {
44
44
  $(".payola-subscription-checkout-button-spinner").show();
45
45
  $.ajax({
46
46
  type: "POST",
47
- url: options.base_path + "/subscribe/" + options.plan_class + "/" + options.plan_id,
47
+ url: form.attr('action'),
48
48
  data: form.serialize(),
49
49
  success: function(data) { PayolaSubscriptionCheckout.poll(data.guid, 60, options); },
50
50
  error: function(data) { PayolaSubscriptionCheckout.showError(data.responseJSON.error, options); }
@@ -0,0 +1,27 @@
1
+ module Payola
2
+ class UpdateCard
3
+ def self.call(subscription, token)
4
+ secret_key = Payola.secret_key_for_sale(subscription)
5
+ begin
6
+ customer = Stripe::Customer.retrieve(subscription.stripe_customer_id, secret_key)
7
+
8
+ customer.source = token
9
+ customer.save
10
+
11
+ customer = Stripe::Customer.retrieve(subscription.stripe_customer_id, secret_key)
12
+ card = customer.sources.retrieve(customer.default_source, secret_key)
13
+
14
+ subscription.update_attributes(
15
+ card_type: card.brand,
16
+ card_last4: card.last4,
17
+ card_expiration: Date.parse("#{card.exp_year}/#{card.exp_month}/1")
18
+ )
19
+ subscription.save!
20
+ rescue RuntimeError, Stripe::StripeError => e
21
+ subscription.errors[:base] << e.message
22
+ end
23
+
24
+ subscription
25
+ end
26
+ end
27
+ end
@@ -20,7 +20,7 @@ module Payola
20
20
 
21
21
  charge = Stripe::Charge.retrieve(invoice.charge, secret_key)
22
22
 
23
- update_sale_with_charge(sale, charge)
23
+ update_sale_with_charge(sale, charge, secret_key)
24
24
 
25
25
  return sale, charge
26
26
  end
@@ -37,7 +37,7 @@ module Payola
37
37
  end
38
38
  end
39
39
 
40
- def update_sale_with_charge(sale, charge)
40
+ def update_sale_with_charge(sale, charge, secret_key)
41
41
  sale.stripe_id = charge.id
42
42
  sale.card_type = charge.source.brand
43
43
  sale.card_last4 = charge.source.last4
@@ -1,7 +1,7 @@
1
1
  module Payola
2
2
  class StartSubscription
3
3
  attr_reader :subscription, :secret_key
4
-
4
+
5
5
  def self.call(subscription)
6
6
  subscription.save!
7
7
  secret_key = Payola.secret_key_for_sale(subscription)
@@ -59,16 +59,19 @@ module Payola
59
59
  if subs && subs.length >= 1
60
60
  first_sub = subs.first
61
61
  customer_id = first_sub.stripe_customer_id
62
- return Stripe::Customer.retrieve(customer_id, secret_key)
63
- else
64
- customer_create_params = {
65
- source: subscription.stripe_token,
66
- email: subscription.email
67
- }
68
-
69
- customer = Stripe::Customer.create(customer_create_params, secret_key)
62
+ unless customer_id.blank?
63
+ customer = Stripe::Customer.retrieve(customer_id, secret_key)
64
+ return customer unless customer.try(:deleted)
65
+ end
70
66
  end
71
67
 
68
+ customer_create_params = {
69
+ source: subscription.stripe_token,
70
+ email: subscription.email
71
+ }
72
+
73
+ customer = Stripe::Customer.create(customer_create_params, secret_key)
74
+
72
75
  if subscription.setup_fee.present?
73
76
  plan = subscription.plan
74
77
  description = plan.try(:setup_fee_description, subscription) || 'Setup Fee'
@@ -84,4 +87,4 @@ module Payola
84
87
  end
85
88
  end
86
89
 
87
- end
90
+ end
@@ -1,10 +1,14 @@
1
1
  <%
2
2
  button_class = local_assigns.fetch :button_class, 'stripe-button-el'
3
+ button_id = local_assigns.fetch :button_id, "cancel-subscription-#{subscription.guid}"
3
4
  button_text = local_assigns.fetch :button_text, "Cancel Subscription"
4
5
  confirm_text = local_assigns.fetch :confirm_text, "Are you sure?"
5
- disabled = subscription.active?
6
+ disabled = !subscription.active?
7
+ url = local_assigns.fetch :url, payola.cancel_subscription_path(subscription.guid)
6
8
  %>
7
9
 
8
- <%= form_tag payola.cancel_subscription_path(subscription.guid), :method => :delete do %>
9
- <%= submit_tag button_text, html: { disabled: disabled, class: button_class }, data: { confirm: confirm_text } %>
10
- <% end %>
10
+ <%= form_tag url, :method => :delete do %>
11
+ <%= button_tag type: 'submit', class: button_class, disabled: disabled, data: { confirm: confirm_text } do %>
12
+ <%= content_tag(:span, button_text, class: 'payola-subscription-cancel-buton-text') %>
13
+ <% end -%>
14
+ <% end -%>
@@ -16,11 +16,12 @@
16
16
  custom_fields = local_assigns.fetch :custom_fields, nil
17
17
  billing_address = local_assigns.fetch :billing_address, false
18
18
  shipping_address = local_assigns.fetch :shipping_address, false
19
+ form_url = local_assigns.fetch :form_url, payola.subscribe_path(plan_class: plan_class, plan_id: plan_id)
19
20
 
20
21
  sale = Payola::Subscription.new(plan: plan)
21
22
 
22
23
  button_id = "payola-button-#{plan_class}-#{plan_id}"
23
-
24
+
24
25
  form_id = "#{button_id}-form"
25
26
 
26
27
  currency = plan.respond_to?(:currency) ? plan.currency : Payola.default_currency
@@ -67,7 +68,7 @@
67
68
  <script src="https://checkout.stripe.com/checkout.js"></script>
68
69
  <link rel="stylesheet" href="https://checkout.stripe.com/v3/checkout/button.css"></link>
69
70
 
70
- <%= form_tag payola.subscribe_path(plan_class: plan_class, plan_id: plan_id), html_hash do %>
71
+ <%= form_tag form_url, html_hash do %>
71
72
  <button class="<%= button_class %> payola-subscription-checkout-button" id="<%= button_id %>">
72
73
  <span class="payola-subscription-checkout-button-text" style="display: block; <%= button_inner_style %>"><%= button_text %></span>
73
74
  <span class="payola-subscription-checkout-button-spinner" style="display: none; <%= button_inner_style %>">Please wait...</span>
@@ -1,10 +1,10 @@
1
1
  class CreatePayolaSales < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :payola_sales do |t|
4
- t.string "email"
5
- t.string "guid"
4
+ t.string "email", limit: 191
5
+ t.string "guid", limit: 191
6
6
  t.integer "product_id"
7
- t.string "product_type"
7
+ t.string "product_type", limit: 100
8
8
  t.datetime "created_at"
9
9
  t.datetime "updated_at"
10
10
  t.string "state"
@@ -1,6 +1,6 @@
1
1
  class AddStripeCustomerIdToSale < ActiveRecord::Migration
2
2
  def change
3
- add_column :payola_sales, :stripe_customer_id, :string
3
+ add_column :payola_sales, :stripe_customer_id, :string, limit: 191
4
4
  add_index :payola_sales, :stripe_customer_id
5
5
  end
6
6
  end
@@ -1,7 +1,7 @@
1
1
  class AddOwnerToPayolaSale < ActiveRecord::Migration
2
2
  def change
3
3
  add_column :payola_sales, :owner_id, :integer
4
- add_column :payola_sales, :owner_type, :string
4
+ add_column :payola_sales, :owner_type, :string, limit: 100
5
5
 
6
6
  add_index :payola_sales, [:owner_id, :owner_type]
7
7
  end
@@ -1,6 +1,6 @@
1
1
  class AddGuidToPayolaSubscriptions < ActiveRecord::Migration
2
2
  def change
3
- add_column :payola_subscriptions, :guid, :string
3
+ add_column :payola_subscriptions, :guid, :string, limit: 191
4
4
  add_index :payola_subscriptions, :guid
5
5
  end
6
6
  end
@@ -118,7 +118,7 @@ module Payola
118
118
  def self.call(params)
119
119
  return nil if StripeWebhook.exists?(stripe_id: params[:id])
120
120
  StripeWebhook.create!(stripe_id: params[:id])
121
- event = Stripe::Event.retrieve(params[:id], Payola.secret_key)
121
+ event = Stripe::Event.retrieve(params[:id], { api_key: Payola.secret_key })
122
122
  Payola.event_filter.call(event)
123
123
  end
124
124
  end
@@ -1,3 +1,3 @@
1
1
  module Payola
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
Binary file
@@ -6341,3 +6341,671 @@ Migrating to AddActiveToPayolaCoupon (20141213205847)
6341
6341
  FROM sqlite_temp_master
6342
6342
  WHERE name='index_payola_subscriptions_on_guid' AND type='index'
6343
6343
  
6344
+ Payola v1.3.0. See LICENSE and the LGPL-3.0 for licensing details.
6345
+ Upgrade to Payola Pro for more features and support. https://www.payola.io/pro
6346
+  (0.9ms) CREATE TABLE "owners" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime) 
6347
+  (0.8ms) CREATE TABLE "payola_affiliates" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar, "email" varchar, "percent" integer, "created_at" datetime, "updated_at" datetime)
6348
+  (1.1ms) CREATE TABLE "payola_coupons" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar, "percent_off" integer, "created_at" datetime, "updated_at" datetime, "active" boolean DEFAULT 't') 
6349
+  (0.8ms) CREATE TABLE "payola_sales" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar, "guid" varchar, "product_id" integer, "product_type" varchar, "created_at" datetime, "updated_at" datetime, "state" varchar, "stripe_id" varchar, "stripe_token" varchar, "card_last4" varchar, "card_expiration" date, "card_type" varchar, "error" text, "amount" integer, "fee_amount" integer, "coupon_id" integer, "opt_in" boolean, "download_count" integer, "affiliate_id" integer, "customer_address" text, "business_address" text, "stripe_customer_id" varchar, "currency" varchar, "signed_custom_fields" text, "owner_id" integer, "owner_type" varchar)
6350
+  (0.8ms) select sqlite_version(*)
6351
+  (0.8ms) CREATE INDEX "index_payola_sales_on_coupon_id" ON "payola_sales" ("coupon_id")
6352
+  (0.1ms)  SELECT sql
6353
+ FROM sqlite_master
6354
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6355
+ UNION ALL
6356
+ SELECT sql
6357
+ FROM sqlite_temp_master
6358
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6359
+ 
6360
+  (0.8ms) CREATE INDEX "index_payola_sales_on_email" ON "payola_sales" ("email")
6361
+  (0.1ms)  SELECT sql
6362
+ FROM sqlite_master
6363
+ WHERE name='index_payola_sales_on_email' AND type='index'
6364
+ UNION ALL
6365
+ SELECT sql
6366
+ FROM sqlite_temp_master
6367
+ WHERE name='index_payola_sales_on_email' AND type='index'
6368
+ 
6369
+  (0.1ms) SELECT sql
6370
+ FROM sqlite_master
6371
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6372
+ UNION ALL
6373
+ SELECT sql
6374
+ FROM sqlite_temp_master
6375
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6376
+
6377
+  (0.7ms) CREATE INDEX "index_payola_sales_on_guid" ON "payola_sales" ("guid")
6378
+  (0.1ms) SELECT sql
6379
+ FROM sqlite_master
6380
+ WHERE name='index_payola_sales_on_guid' AND type='index'
6381
+ UNION ALL
6382
+ SELECT sql
6383
+ FROM sqlite_temp_master
6384
+ WHERE name='index_payola_sales_on_guid' AND type='index'
6385
+
6386
+  (0.1ms)  SELECT sql
6387
+ FROM sqlite_master
6388
+ WHERE name='index_payola_sales_on_email' AND type='index'
6389
+ UNION ALL
6390
+ SELECT sql
6391
+ FROM sqlite_temp_master
6392
+ WHERE name='index_payola_sales_on_email' AND type='index'
6393
+ 
6394
+  (0.1ms) SELECT sql
6395
+ FROM sqlite_master
6396
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6397
+ UNION ALL
6398
+ SELECT sql
6399
+ FROM sqlite_temp_master
6400
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6401
+
6402
+  (0.9ms) CREATE INDEX "index_payola_sales_on_owner_id_and_owner_type" ON "payola_sales" ("owner_id", "owner_type")
6403
+  (0.1ms) SELECT sql
6404
+ FROM sqlite_master
6405
+ WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
6406
+ UNION ALL
6407
+ SELECT sql
6408
+ FROM sqlite_temp_master
6409
+ WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
6410
+
6411
+  (0.1ms)  SELECT sql
6412
+ FROM sqlite_master
6413
+ WHERE name='index_payola_sales_on_guid' AND type='index'
6414
+ UNION ALL
6415
+ SELECT sql
6416
+ FROM sqlite_temp_master
6417
+ WHERE name='index_payola_sales_on_guid' AND type='index'
6418
+ 
6419
+  (0.1ms) SELECT sql
6420
+ FROM sqlite_master
6421
+ WHERE name='index_payola_sales_on_email' AND type='index'
6422
+ UNION ALL
6423
+ SELECT sql
6424
+ FROM sqlite_temp_master
6425
+ WHERE name='index_payola_sales_on_email' AND type='index'
6426
+
6427
+  (0.1ms)  SELECT sql
6428
+ FROM sqlite_master
6429
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6430
+ UNION ALL
6431
+ SELECT sql
6432
+ FROM sqlite_temp_master
6433
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6434
+ 
6435
+  (1.1ms) CREATE INDEX "index_payola_sales_on_product" ON "payola_sales" ("product_id", "product_type")
6436
+  (0.1ms)  SELECT sql
6437
+ FROM sqlite_master
6438
+ WHERE name='index_payola_sales_on_product' AND type='index'
6439
+ UNION ALL
6440
+ SELECT sql
6441
+ FROM sqlite_temp_master
6442
+ WHERE name='index_payola_sales_on_product' AND type='index'
6443
+ 
6444
+  (0.1ms) SELECT sql
6445
+ FROM sqlite_master
6446
+ WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
6447
+ UNION ALL
6448
+ SELECT sql
6449
+ FROM sqlite_temp_master
6450
+ WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
6451
+
6452
+  (0.1ms)  SELECT sql
6453
+ FROM sqlite_master
6454
+ WHERE name='index_payola_sales_on_guid' AND type='index'
6455
+ UNION ALL
6456
+ SELECT sql
6457
+ FROM sqlite_temp_master
6458
+ WHERE name='index_payola_sales_on_guid' AND type='index'
6459
+ 
6460
+  (0.1ms) SELECT sql
6461
+ FROM sqlite_master
6462
+ WHERE name='index_payola_sales_on_email' AND type='index'
6463
+ UNION ALL
6464
+ SELECT sql
6465
+ FROM sqlite_temp_master
6466
+ WHERE name='index_payola_sales_on_email' AND type='index'
6467
+
6468
+  (0.1ms)  SELECT sql
6469
+ FROM sqlite_master
6470
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6471
+ UNION ALL
6472
+ SELECT sql
6473
+ FROM sqlite_temp_master
6474
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6475
+ 
6476
+  (0.9ms) CREATE INDEX "index_payola_sales_on_stripe_customer_id" ON "payola_sales" ("stripe_customer_id")
6477
+  (0.8ms) CREATE TABLE "payola_stripe_webhooks" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stripe_id" varchar, "created_at" datetime, "updated_at" datetime) 
6478
+  (0.8ms) CREATE TABLE "payola_subscriptions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "plan_type" varchar, "plan_id" integer, "start" datetime, "status" varchar, "owner_type" varchar, "owner_id" integer, "stripe_customer_id" varchar, "cancel_at_period_end" boolean, "current_period_start" datetime, "current_period_end" datetime, "ended_at" datetime, "trial_start" datetime, "trial_end" datetime, "canceled_at" datetime, "quantity" integer, "stripe_id" varchar, "stripe_token" varchar, "card_last4" varchar, "card_expiration" date, "card_type" varchar, "error" text, "state" varchar, "email" varchar, "created_at" datetime, "updated_at" datetime, "currency" varchar, "amount" integer, "guid" varchar, "stripe_status" varchar, "affiliate_id" integer, "coupon" varchar, "signed_custom_fields" text, "customer_address" text, "business_address" text, "setup_fee" integer)
6479
+  (0.8ms) CREATE INDEX "index_payola_subscriptions_on_guid" ON "payola_subscriptions" ("guid")
6480
+  (0.8ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "permalink" varchar, "price" integer, "created_at" datetime, "updated_at" datetime)
6481
+  (0.9ms) CREATE TABLE "subscription_plan_without_interval_counts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "stripe_id" varchar, "amount" integer, "interval" varchar, "created_at" datetime, "updated_at" datetime) 
6482
+  (0.9ms) CREATE TABLE "subscription_plans" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "amount" integer, "interval" varchar, "interval_count" integer, "name" varchar, "stripe_id" varchar, "trial_period_days" integer, "created_at" datetime, "updated_at" datetime)
6483
+  (0.7ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime) 
6484
+  (1.0ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
6485
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
6486
+  (0.1ms) SELECT version FROM "schema_migrations"
6487
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20141213205847')
6488
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141001230848')
6489
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20141029140518')
6490
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141105010234')
6491
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141120170744')
6492
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20141204170622')
6493
+  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20141001170138')
6494
+  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20141001203541')
6495
+  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20141002013618')
6496
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20141002013701')
6497
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141002203725')
6498
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141017233304')
6499
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141026101628')
6500
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141026144800')
6501
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141029135848')
6502
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141105043439')
6503
+  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20141106034610')
6504
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141107025420')
6505
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141109203101')
6506
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141112024805')
6507
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141114032013')
6508
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20141114154223')
6509
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20141114163841')
6510
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141122020755')
6511
+ Payola v1.3.0. See LICENSE and the LGPL-3.0 for licensing details.
6512
+ Upgrade to Payola Pro for more features and support. https://www.payola.io/pro
6513
+  (0.9ms) CREATE TABLE "owners" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime) 
6514
+  (1.1ms) CREATE TABLE "payola_affiliates" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar, "email" varchar, "percent" integer, "created_at" datetime, "updated_at" datetime)
6515
+  (0.9ms) CREATE TABLE "payola_coupons" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar, "percent_off" integer, "created_at" datetime, "updated_at" datetime, "active" boolean DEFAULT 't') 
6516
+  (0.9ms) CREATE TABLE "payola_sales" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar, "guid" varchar, "product_id" integer, "product_type" varchar, "created_at" datetime, "updated_at" datetime, "state" varchar, "stripe_id" varchar, "stripe_token" varchar, "card_last4" varchar, "card_expiration" date, "card_type" varchar, "error" text, "amount" integer, "fee_amount" integer, "coupon_id" integer, "opt_in" boolean, "download_count" integer, "affiliate_id" integer, "customer_address" text, "business_address" text, "stripe_customer_id" varchar, "currency" varchar, "signed_custom_fields" text, "owner_id" integer, "owner_type" varchar)
6517
+  (0.2ms) select sqlite_version(*)
6518
+  (0.9ms) CREATE INDEX "index_payola_sales_on_coupon_id" ON "payola_sales" ("coupon_id")
6519
+  (0.2ms)  SELECT sql
6520
+ FROM sqlite_master
6521
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6522
+ UNION ALL
6523
+ SELECT sql
6524
+ FROM sqlite_temp_master
6525
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6526
+ 
6527
+  (0.7ms) CREATE INDEX "index_payola_sales_on_email" ON "payola_sales" ("email")
6528
+  (0.1ms)  SELECT sql
6529
+ FROM sqlite_master
6530
+ WHERE name='index_payola_sales_on_email' AND type='index'
6531
+ UNION ALL
6532
+ SELECT sql
6533
+ FROM sqlite_temp_master
6534
+ WHERE name='index_payola_sales_on_email' AND type='index'
6535
+ 
6536
+  (0.1ms) SELECT sql
6537
+ FROM sqlite_master
6538
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6539
+ UNION ALL
6540
+ SELECT sql
6541
+ FROM sqlite_temp_master
6542
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6543
+
6544
+  (0.7ms) CREATE INDEX "index_payola_sales_on_guid" ON "payola_sales" ("guid")
6545
+  (0.1ms) SELECT sql
6546
+ FROM sqlite_master
6547
+ WHERE name='index_payola_sales_on_guid' AND type='index'
6548
+ UNION ALL
6549
+ SELECT sql
6550
+ FROM sqlite_temp_master
6551
+ WHERE name='index_payola_sales_on_guid' AND type='index'
6552
+
6553
+  (0.1ms)  SELECT sql
6554
+ FROM sqlite_master
6555
+ WHERE name='index_payola_sales_on_email' AND type='index'
6556
+ UNION ALL
6557
+ SELECT sql
6558
+ FROM sqlite_temp_master
6559
+ WHERE name='index_payola_sales_on_email' AND type='index'
6560
+ 
6561
+  (0.1ms) SELECT sql
6562
+ FROM sqlite_master
6563
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6564
+ UNION ALL
6565
+ SELECT sql
6566
+ FROM sqlite_temp_master
6567
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6568
+
6569
+  (1.2ms) CREATE INDEX "index_payola_sales_on_owner_id_and_owner_type" ON "payola_sales" ("owner_id", "owner_type")
6570
+  (0.1ms) SELECT sql
6571
+ FROM sqlite_master
6572
+ WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
6573
+ UNION ALL
6574
+ SELECT sql
6575
+ FROM sqlite_temp_master
6576
+ WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
6577
+
6578
+  (0.1ms)  SELECT sql
6579
+ FROM sqlite_master
6580
+ WHERE name='index_payola_sales_on_guid' AND type='index'
6581
+ UNION ALL
6582
+ SELECT sql
6583
+ FROM sqlite_temp_master
6584
+ WHERE name='index_payola_sales_on_guid' AND type='index'
6585
+ 
6586
+  (0.1ms) SELECT sql
6587
+ FROM sqlite_master
6588
+ WHERE name='index_payola_sales_on_email' AND type='index'
6589
+ UNION ALL
6590
+ SELECT sql
6591
+ FROM sqlite_temp_master
6592
+ WHERE name='index_payola_sales_on_email' AND type='index'
6593
+
6594
+  (0.1ms)  SELECT sql
6595
+ FROM sqlite_master
6596
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6597
+ UNION ALL
6598
+ SELECT sql
6599
+ FROM sqlite_temp_master
6600
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6601
+ 
6602
+  (1.1ms) CREATE INDEX "index_payola_sales_on_product" ON "payola_sales" ("product_id", "product_type")
6603
+  (0.1ms)  SELECT sql
6604
+ FROM sqlite_master
6605
+ WHERE name='index_payola_sales_on_product' AND type='index'
6606
+ UNION ALL
6607
+ SELECT sql
6608
+ FROM sqlite_temp_master
6609
+ WHERE name='index_payola_sales_on_product' AND type='index'
6610
+ 
6611
+  (0.1ms) SELECT sql
6612
+ FROM sqlite_master
6613
+ WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
6614
+ UNION ALL
6615
+ SELECT sql
6616
+ FROM sqlite_temp_master
6617
+ WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
6618
+
6619
+  (0.1ms)  SELECT sql
6620
+ FROM sqlite_master
6621
+ WHERE name='index_payola_sales_on_guid' AND type='index'
6622
+ UNION ALL
6623
+ SELECT sql
6624
+ FROM sqlite_temp_master
6625
+ WHERE name='index_payola_sales_on_guid' AND type='index'
6626
+ 
6627
+  (0.1ms) SELECT sql
6628
+ FROM sqlite_master
6629
+ WHERE name='index_payola_sales_on_email' AND type='index'
6630
+ UNION ALL
6631
+ SELECT sql
6632
+ FROM sqlite_temp_master
6633
+ WHERE name='index_payola_sales_on_email' AND type='index'
6634
+
6635
+  (0.1ms)  SELECT sql
6636
+ FROM sqlite_master
6637
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6638
+ UNION ALL
6639
+ SELECT sql
6640
+ FROM sqlite_temp_master
6641
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6642
+ 
6643
+  (0.8ms) CREATE INDEX "index_payola_sales_on_stripe_customer_id" ON "payola_sales" ("stripe_customer_id")
6644
+  (0.7ms) CREATE TABLE "payola_stripe_webhooks" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stripe_id" varchar, "created_at" datetime, "updated_at" datetime) 
6645
+  (0.8ms) CREATE TABLE "payola_subscriptions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "plan_type" varchar, "plan_id" integer, "start" datetime, "status" varchar, "owner_type" varchar, "owner_id" integer, "stripe_customer_id" varchar, "cancel_at_period_end" boolean, "current_period_start" datetime, "current_period_end" datetime, "ended_at" datetime, "trial_start" datetime, "trial_end" datetime, "canceled_at" datetime, "quantity" integer, "stripe_id" varchar, "stripe_token" varchar, "card_last4" varchar, "card_expiration" date, "card_type" varchar, "error" text, "state" varchar, "email" varchar, "created_at" datetime, "updated_at" datetime, "currency" varchar, "amount" integer, "guid" varchar, "stripe_status" varchar, "affiliate_id" integer, "coupon" varchar, "signed_custom_fields" text, "customer_address" text, "business_address" text, "setup_fee" integer)
6646
+  (0.7ms) CREATE INDEX "index_payola_subscriptions_on_guid" ON "payola_subscriptions" ("guid")
6647
+  (0.8ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "permalink" varchar, "price" integer, "created_at" datetime, "updated_at" datetime)
6648
+  (0.7ms) CREATE TABLE "subscription_plan_without_interval_counts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "stripe_id" varchar, "amount" integer, "interval" varchar, "created_at" datetime, "updated_at" datetime) 
6649
+  (0.9ms) CREATE TABLE "subscription_plans" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "amount" integer, "interval" varchar, "interval_count" integer, "name" varchar, "stripe_id" varchar, "trial_period_days" integer, "created_at" datetime, "updated_at" datetime)
6650
+  (0.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime) 
6651
+  (0.8ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
6652
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
6653
+  (0.1ms) SELECT version FROM "schema_migrations"
6654
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141213205847')
6655
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141001230848')
6656
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141029140518')
6657
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141105010234')
6658
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141120170744')
6659
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141204170622')
6660
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141001170138')
6661
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20141001203541')
6662
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141002013618')
6663
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141002013701')
6664
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141002203725')
6665
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141017233304')
6666
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141026101628')
6667
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141026144800')
6668
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141029135848')
6669
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20141105043439')
6670
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20141106034610')
6671
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141107025420')
6672
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141109203101')
6673
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141112024805')
6674
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141114032013')
6675
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141114154223')
6676
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141114163841')
6677
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141122020755')
6678
+ Payola v1.3.0. See LICENSE and the LGPL-3.0 for licensing details.
6679
+ Upgrade to Payola Pro for more features and support. https://www.payola.io/pro
6680
+  (0.9ms) CREATE TABLE "owners" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime) 
6681
+  (0.6ms) CREATE TABLE "payola_affiliates" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar, "email" varchar, "percent" integer, "created_at" datetime, "updated_at" datetime)
6682
+  (0.8ms) CREATE TABLE "payola_coupons" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar, "percent_off" integer, "created_at" datetime, "updated_at" datetime, "active" boolean DEFAULT 't') 
6683
+  (0.9ms) CREATE TABLE "payola_sales" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar, "guid" varchar, "product_id" integer, "product_type" varchar, "created_at" datetime, "updated_at" datetime, "state" varchar, "stripe_id" varchar, "stripe_token" varchar, "card_last4" varchar, "card_expiration" date, "card_type" varchar, "error" text, "amount" integer, "fee_amount" integer, "coupon_id" integer, "opt_in" boolean, "download_count" integer, "affiliate_id" integer, "customer_address" text, "business_address" text, "stripe_customer_id" varchar, "currency" varchar, "signed_custom_fields" text, "owner_id" integer, "owner_type" varchar)
6684
+  (0.1ms) select sqlite_version(*)
6685
+  (0.8ms) CREATE INDEX "index_payola_sales_on_coupon_id" ON "payola_sales" ("coupon_id")
6686
+  (0.1ms)  SELECT sql
6687
+ FROM sqlite_master
6688
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6689
+ UNION ALL
6690
+ SELECT sql
6691
+ FROM sqlite_temp_master
6692
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6693
+ 
6694
+  (0.7ms) CREATE INDEX "index_payola_sales_on_email" ON "payola_sales" ("email")
6695
+  (0.1ms)  SELECT sql
6696
+ FROM sqlite_master
6697
+ WHERE name='index_payola_sales_on_email' AND type='index'
6698
+ UNION ALL
6699
+ SELECT sql
6700
+ FROM sqlite_temp_master
6701
+ WHERE name='index_payola_sales_on_email' AND type='index'
6702
+ 
6703
+  (0.1ms) SELECT sql
6704
+ FROM sqlite_master
6705
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6706
+ UNION ALL
6707
+ SELECT sql
6708
+ FROM sqlite_temp_master
6709
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6710
+
6711
+  (0.7ms) CREATE INDEX "index_payola_sales_on_guid" ON "payola_sales" ("guid")
6712
+  (0.1ms) SELECT sql
6713
+ FROM sqlite_master
6714
+ WHERE name='index_payola_sales_on_guid' AND type='index'
6715
+ UNION ALL
6716
+ SELECT sql
6717
+ FROM sqlite_temp_master
6718
+ WHERE name='index_payola_sales_on_guid' AND type='index'
6719
+
6720
+  (0.1ms)  SELECT sql
6721
+ FROM sqlite_master
6722
+ WHERE name='index_payola_sales_on_email' AND type='index'
6723
+ UNION ALL
6724
+ SELECT sql
6725
+ FROM sqlite_temp_master
6726
+ WHERE name='index_payola_sales_on_email' AND type='index'
6727
+ 
6728
+  (0.1ms) SELECT sql
6729
+ FROM sqlite_master
6730
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6731
+ UNION ALL
6732
+ SELECT sql
6733
+ FROM sqlite_temp_master
6734
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6735
+
6736
+  (0.8ms) CREATE INDEX "index_payola_sales_on_owner_id_and_owner_type" ON "payola_sales" ("owner_id", "owner_type")
6737
+  (0.1ms) SELECT sql
6738
+ FROM sqlite_master
6739
+ WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
6740
+ UNION ALL
6741
+ SELECT sql
6742
+ FROM sqlite_temp_master
6743
+ WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
6744
+
6745
+  (0.1ms)  SELECT sql
6746
+ FROM sqlite_master
6747
+ WHERE name='index_payola_sales_on_guid' AND type='index'
6748
+ UNION ALL
6749
+ SELECT sql
6750
+ FROM sqlite_temp_master
6751
+ WHERE name='index_payola_sales_on_guid' AND type='index'
6752
+ 
6753
+  (0.1ms) SELECT sql
6754
+ FROM sqlite_master
6755
+ WHERE name='index_payola_sales_on_email' AND type='index'
6756
+ UNION ALL
6757
+ SELECT sql
6758
+ FROM sqlite_temp_master
6759
+ WHERE name='index_payola_sales_on_email' AND type='index'
6760
+
6761
+  (0.1ms)  SELECT sql
6762
+ FROM sqlite_master
6763
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6764
+ UNION ALL
6765
+ SELECT sql
6766
+ FROM sqlite_temp_master
6767
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6768
+ 
6769
+  (0.8ms) CREATE INDEX "index_payola_sales_on_product" ON "payola_sales" ("product_id", "product_type")
6770
+  (0.1ms)  SELECT sql
6771
+ FROM sqlite_master
6772
+ WHERE name='index_payola_sales_on_product' AND type='index'
6773
+ UNION ALL
6774
+ SELECT sql
6775
+ FROM sqlite_temp_master
6776
+ WHERE name='index_payola_sales_on_product' AND type='index'
6777
+ 
6778
+  (0.1ms) SELECT sql
6779
+ FROM sqlite_master
6780
+ WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
6781
+ UNION ALL
6782
+ SELECT sql
6783
+ FROM sqlite_temp_master
6784
+ WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
6785
+
6786
+  (0.1ms)  SELECT sql
6787
+ FROM sqlite_master
6788
+ WHERE name='index_payola_sales_on_guid' AND type='index'
6789
+ UNION ALL
6790
+ SELECT sql
6791
+ FROM sqlite_temp_master
6792
+ WHERE name='index_payola_sales_on_guid' AND type='index'
6793
+ 
6794
+  (0.1ms) SELECT sql
6795
+ FROM sqlite_master
6796
+ WHERE name='index_payola_sales_on_email' AND type='index'
6797
+ UNION ALL
6798
+ SELECT sql
6799
+ FROM sqlite_temp_master
6800
+ WHERE name='index_payola_sales_on_email' AND type='index'
6801
+
6802
+  (0.1ms)  SELECT sql
6803
+ FROM sqlite_master
6804
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6805
+ UNION ALL
6806
+ SELECT sql
6807
+ FROM sqlite_temp_master
6808
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6809
+ 
6810
+  (0.8ms) CREATE INDEX "index_payola_sales_on_stripe_customer_id" ON "payola_sales" ("stripe_customer_id")
6811
+  (0.9ms) CREATE TABLE "payola_stripe_webhooks" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stripe_id" varchar, "created_at" datetime, "updated_at" datetime) 
6812
+  (0.8ms) CREATE TABLE "payola_subscriptions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "plan_type" varchar, "plan_id" integer, "start" datetime, "status" varchar, "owner_type" varchar, "owner_id" integer, "stripe_customer_id" varchar, "cancel_at_period_end" boolean, "current_period_start" datetime, "current_period_end" datetime, "ended_at" datetime, "trial_start" datetime, "trial_end" datetime, "canceled_at" datetime, "quantity" integer, "stripe_id" varchar, "stripe_token" varchar, "card_last4" varchar, "card_expiration" date, "card_type" varchar, "error" text, "state" varchar, "email" varchar, "created_at" datetime, "updated_at" datetime, "currency" varchar, "amount" integer, "guid" varchar, "stripe_status" varchar, "affiliate_id" integer, "coupon" varchar, "signed_custom_fields" text, "customer_address" text, "business_address" text, "setup_fee" integer)
6813
+  (0.6ms) CREATE INDEX "index_payola_subscriptions_on_guid" ON "payola_subscriptions" ("guid")
6814
+  (0.7ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "permalink" varchar, "price" integer, "created_at" datetime, "updated_at" datetime)
6815
+  (0.8ms) CREATE TABLE "subscription_plan_without_interval_counts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "stripe_id" varchar, "amount" integer, "interval" varchar, "created_at" datetime, "updated_at" datetime) 
6816
+  (0.9ms) CREATE TABLE "subscription_plans" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "amount" integer, "interval" varchar, "interval_count" integer, "name" varchar, "stripe_id" varchar, "trial_period_days" integer, "created_at" datetime, "updated_at" datetime)
6817
+  (0.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime) 
6818
+  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
6819
+  (0.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
6820
+  (0.1ms) SELECT version FROM "schema_migrations"
6821
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141213205847')
6822
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141001230848')
6823
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141029140518')
6824
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20141105010234')
6825
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141120170744')
6826
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141204170622')
6827
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141001170138')
6828
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141001203541')
6829
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141002013618')
6830
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141002013701')
6831
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141002203725')
6832
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20141017233304')
6833
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141026101628')
6834
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141026144800')
6835
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20141029135848')
6836
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20141105043439')
6837
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141106034610')
6838
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141107025420')
6839
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141109203101')
6840
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141112024805')
6841
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20141114032013')
6842
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141114154223')
6843
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20141114163841')
6844
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141122020755')
6845
+ Payola v1.3.0. See LICENSE and the LGPL-3.0 for licensing details.
6846
+ Upgrade to Payola Pro for more features and support. https://www.payola.io/pro
6847
+  (1.5ms) CREATE TABLE "owners" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime) 
6848
+  (0.7ms) CREATE TABLE "payola_affiliates" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar, "email" varchar, "percent" integer, "created_at" datetime, "updated_at" datetime)
6849
+  (0.9ms) CREATE TABLE "payola_coupons" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar, "percent_off" integer, "created_at" datetime, "updated_at" datetime, "active" boolean DEFAULT 't') 
6850
+  (0.8ms) CREATE TABLE "payola_sales" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar, "guid" varchar, "product_id" integer, "product_type" varchar, "created_at" datetime, "updated_at" datetime, "state" varchar, "stripe_id" varchar, "stripe_token" varchar, "card_last4" varchar, "card_expiration" date, "card_type" varchar, "error" text, "amount" integer, "fee_amount" integer, "coupon_id" integer, "opt_in" boolean, "download_count" integer, "affiliate_id" integer, "customer_address" text, "business_address" text, "stripe_customer_id" varchar, "currency" varchar, "signed_custom_fields" text, "owner_id" integer, "owner_type" varchar)
6851
+  (0.1ms) select sqlite_version(*)
6852
+  (0.8ms) CREATE INDEX "index_payola_sales_on_coupon_id" ON "payola_sales" ("coupon_id")
6853
+  (0.1ms)  SELECT sql
6854
+ FROM sqlite_master
6855
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6856
+ UNION ALL
6857
+ SELECT sql
6858
+ FROM sqlite_temp_master
6859
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6860
+ 
6861
+  (0.8ms) CREATE INDEX "index_payola_sales_on_email" ON "payola_sales" ("email")
6862
+  (0.1ms)  SELECT sql
6863
+ FROM sqlite_master
6864
+ WHERE name='index_payola_sales_on_email' AND type='index'
6865
+ UNION ALL
6866
+ SELECT sql
6867
+ FROM sqlite_temp_master
6868
+ WHERE name='index_payola_sales_on_email' AND type='index'
6869
+ 
6870
+  (0.1ms) SELECT sql
6871
+ FROM sqlite_master
6872
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6873
+ UNION ALL
6874
+ SELECT sql
6875
+ FROM sqlite_temp_master
6876
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6877
+
6878
+  (0.7ms) CREATE INDEX "index_payola_sales_on_guid" ON "payola_sales" ("guid")
6879
+  (0.1ms) SELECT sql
6880
+ FROM sqlite_master
6881
+ WHERE name='index_payola_sales_on_guid' AND type='index'
6882
+ UNION ALL
6883
+ SELECT sql
6884
+ FROM sqlite_temp_master
6885
+ WHERE name='index_payola_sales_on_guid' AND type='index'
6886
+
6887
+  (0.1ms)  SELECT sql
6888
+ FROM sqlite_master
6889
+ WHERE name='index_payola_sales_on_email' AND type='index'
6890
+ UNION ALL
6891
+ SELECT sql
6892
+ FROM sqlite_temp_master
6893
+ WHERE name='index_payola_sales_on_email' AND type='index'
6894
+ 
6895
+  (0.1ms) SELECT sql
6896
+ FROM sqlite_master
6897
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6898
+ UNION ALL
6899
+ SELECT sql
6900
+ FROM sqlite_temp_master
6901
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6902
+
6903
+  (0.7ms) CREATE INDEX "index_payola_sales_on_owner_id_and_owner_type" ON "payola_sales" ("owner_id", "owner_type")
6904
+  (0.1ms) SELECT sql
6905
+ FROM sqlite_master
6906
+ WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
6907
+ UNION ALL
6908
+ SELECT sql
6909
+ FROM sqlite_temp_master
6910
+ WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
6911
+
6912
+  (0.1ms)  SELECT sql
6913
+ FROM sqlite_master
6914
+ WHERE name='index_payola_sales_on_guid' AND type='index'
6915
+ UNION ALL
6916
+ SELECT sql
6917
+ FROM sqlite_temp_master
6918
+ WHERE name='index_payola_sales_on_guid' AND type='index'
6919
+ 
6920
+  (0.1ms) SELECT sql
6921
+ FROM sqlite_master
6922
+ WHERE name='index_payola_sales_on_email' AND type='index'
6923
+ UNION ALL
6924
+ SELECT sql
6925
+ FROM sqlite_temp_master
6926
+ WHERE name='index_payola_sales_on_email' AND type='index'
6927
+
6928
+  (0.1ms)  SELECT sql
6929
+ FROM sqlite_master
6930
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6931
+ UNION ALL
6932
+ SELECT sql
6933
+ FROM sqlite_temp_master
6934
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6935
+ 
6936
+  (0.7ms) CREATE INDEX "index_payola_sales_on_product" ON "payola_sales" ("product_id", "product_type")
6937
+  (0.1ms)  SELECT sql
6938
+ FROM sqlite_master
6939
+ WHERE name='index_payola_sales_on_product' AND type='index'
6940
+ UNION ALL
6941
+ SELECT sql
6942
+ FROM sqlite_temp_master
6943
+ WHERE name='index_payola_sales_on_product' AND type='index'
6944
+ 
6945
+  (0.1ms) SELECT sql
6946
+ FROM sqlite_master
6947
+ WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
6948
+ UNION ALL
6949
+ SELECT sql
6950
+ FROM sqlite_temp_master
6951
+ WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
6952
+
6953
+  (0.1ms)  SELECT sql
6954
+ FROM sqlite_master
6955
+ WHERE name='index_payola_sales_on_guid' AND type='index'
6956
+ UNION ALL
6957
+ SELECT sql
6958
+ FROM sqlite_temp_master
6959
+ WHERE name='index_payola_sales_on_guid' AND type='index'
6960
+ 
6961
+  (0.1ms) SELECT sql
6962
+ FROM sqlite_master
6963
+ WHERE name='index_payola_sales_on_email' AND type='index'
6964
+ UNION ALL
6965
+ SELECT sql
6966
+ FROM sqlite_temp_master
6967
+ WHERE name='index_payola_sales_on_email' AND type='index'
6968
+
6969
+  (0.1ms)  SELECT sql
6970
+ FROM sqlite_master
6971
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6972
+ UNION ALL
6973
+ SELECT sql
6974
+ FROM sqlite_temp_master
6975
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
6976
+ 
6977
+  (1.1ms) CREATE INDEX "index_payola_sales_on_stripe_customer_id" ON "payola_sales" ("stripe_customer_id")
6978
+  (0.9ms) CREATE TABLE "payola_stripe_webhooks" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stripe_id" varchar, "created_at" datetime, "updated_at" datetime) 
6979
+  (0.8ms) CREATE TABLE "payola_subscriptions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "plan_type" varchar, "plan_id" integer, "start" datetime, "status" varchar, "owner_type" varchar, "owner_id" integer, "stripe_customer_id" varchar, "cancel_at_period_end" boolean, "current_period_start" datetime, "current_period_end" datetime, "ended_at" datetime, "trial_start" datetime, "trial_end" datetime, "canceled_at" datetime, "quantity" integer, "stripe_id" varchar, "stripe_token" varchar, "card_last4" varchar, "card_expiration" date, "card_type" varchar, "error" text, "state" varchar, "email" varchar, "created_at" datetime, "updated_at" datetime, "currency" varchar, "amount" integer, "guid" varchar, "stripe_status" varchar, "affiliate_id" integer, "coupon" varchar, "signed_custom_fields" text, "customer_address" text, "business_address" text, "setup_fee" integer)
6980
+  (0.7ms) CREATE INDEX "index_payola_subscriptions_on_guid" ON "payola_subscriptions" ("guid")
6981
+  (0.7ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "permalink" varchar, "price" integer, "created_at" datetime, "updated_at" datetime)
6982
+  (0.9ms) CREATE TABLE "subscription_plan_without_interval_counts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "stripe_id" varchar, "amount" integer, "interval" varchar, "created_at" datetime, "updated_at" datetime) 
6983
+  (0.9ms) CREATE TABLE "subscription_plans" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "amount" integer, "interval" varchar, "interval_count" integer, "name" varchar, "stripe_id" varchar, "trial_period_days" integer, "created_at" datetime, "updated_at" datetime)
6984
+  (0.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime) 
6985
+  (2.5ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
6986
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
6987
+  (0.1ms) SELECT version FROM "schema_migrations"
6988
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141213205847')
6989
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20141001230848')
6990
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141029140518')
6991
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141105010234')
6992
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141120170744')
6993
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141204170622')
6994
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20141001170138')
6995
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141001203541')
6996
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141002013618')
6997
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141002013701')
6998
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141002203725')
6999
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20141017233304')
7000
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141026101628')
7001
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141026144800')
7002
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141029135848')
7003
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141105043439')
7004
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141106034610')
7005
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20141107025420')
7006
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20141109203101')
7007
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141112024805')
7008
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141114032013')
7009
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141114154223')
7010
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141114163841')
7011
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141122020755')