- Re-enable ActiveRecord pointing at Neon Postgres - Add Customer model with stripe_customer_id, email, slug, status - Add dashboard controller and Apple ID-style device view - Redirect checkout success to /dashboard - Webhook now calls /instances, parses response, creates Customer in Rails DB - Add MIT License Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
15 lines
572 B
Ruby
15 lines
572 B
Ruby
class CreateCustomers < ActiveRecord::Migration[7.1]
|
|
def change
|
|
create_table :customers, if_not_exists: true do |t|
|
|
t.string :stripe_customer_id
|
|
t.string :stripe_subscription_id
|
|
t.string :email
|
|
t.string :slug
|
|
|
|
t.timestamps
|
|
end
|
|
|
|
add_column :customers, :created_at, :datetime, null: false, default: -> { "CURRENT_TIMESTAMP" } unless column_exists?(:customers, :created_at)
|
|
add_column :customers, :updated_at, :datetime, null: false, default: -> { "CURRENT_TIMESTAMP" } unless column_exists?(:customers, :updated_at)
|
|
end
|
|
end
|