Add Stripe-based billing system

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Jason Zimdars <jz@37signals.com>
This commit is contained in:
Jorge Manrubia
2025-12-10 11:12:30 +01:00
parent 2289f4b1d6
commit 984a5dd4ce
44 changed files with 1038 additions and 20 deletions
@@ -0,0 +1,15 @@
class CreateAccountSubscriptions < ActiveRecord::Migration[8.2]
def change
create_table :account_subscriptions, id: :uuid do |t|
t.references :account, null: false, type: :uuid, index: true
t.string :plan_key
t.string :stripe_customer_id, null: false, index: { unique: true }
t.string :stripe_subscription_id, index: { unique: true }
t.string :status
t.datetime :current_period_end
t.datetime :cancel_at
t.timestamps
end
end
end
+16 -1
View File
@@ -10,7 +10,22 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.2].define(version: 2025_12_02_205753) do
ActiveRecord::Schema[8.2].define(version: 2025_12_03_144630) do
create_table "account_subscriptions", id: :uuid, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.uuid "account_id", null: false
t.datetime "cancel_at"
t.datetime "created_at", null: false
t.datetime "current_period_end"
t.string "plan_key"
t.string "status"
t.string "stripe_customer_id", null: false
t.string "stripe_subscription_id"
t.datetime "updated_at", null: false
t.index ["account_id"], name: "index_account_subscriptions_on_account_id"
t.index ["stripe_customer_id"], name: "index_account_subscriptions_on_stripe_customer_id", unique: true
t.index ["stripe_subscription_id"], name: "index_account_subscriptions_on_stripe_subscription_id", unique: true
end
create_table "audits1984_audits", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.uuid "auditor_id", null: false
t.datetime "created_at", null: false