REFACTOR: Use models to store data (#11)
* REFACTOR: Use api to add subscribe link * FIX: I18n subscribe link * REFACTOR: Use models to store some data This enables the plugin to show only subscription information which was generated on Discourse. Subscription data storage is limited to the external identifiers Stripe generates so we can interact with the API. * DEV: Test/linting fixes/rake task
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
class CreateSubscriptionsCustomers < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
create_table :discourse_subscriptions_customers do |t|
|
||||
t.string :customer_id, null: false
|
||||
t.string :customer_id, null: false, index: true
|
||||
t.string :product_id
|
||||
t.references :user, foreign_key: true
|
||||
t.references :user
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateProducts < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
create_table :discourse_subscriptions_products do |t|
|
||||
t.string :external_id, null: false, index: true
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateSubscriptions < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
create_table :discourse_subscriptions_subscriptions do |t|
|
||||
t.integer :customer_id, null: false, index: true
|
||||
t.string :external_id, null: false, index: true
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user