Skip to content

Instantly share code, notes, and snippets.

@x1wins
Created September 17, 2023 23:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save x1wins/ca4c2e0cc8898f614060a5d87e1b0aba to your computer and use it in GitHub Desktop.
Save x1wins/ca4c2e0cc8898f614060a5d87e1b0aba to your computer and use it in GitHub Desktop.
ahoy, pay gem - schema.rb
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `bin/rails
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.0].define(version: 2023_04_22_020927) do
create_table "ahoy_events", force: :cascade do |t|
t.integer "visit_id"
t.integer "user_id"
t.string "name"
t.text "properties"
t.datetime "time"
t.index ["name", "time"], name: "index_ahoy_events_on_name_and_time"
t.index ["user_id"], name: "index_ahoy_events_on_user_id"
t.index ["visit_id"], name: "index_ahoy_events_on_visit_id"
end
create_table "ahoy_visits", force: :cascade do |t|
t.string "visit_token"
t.string "visitor_token"
t.integer "user_id"
t.string "ip"
t.text "user_agent"
t.text "referrer"
t.string "referring_domain"
t.text "landing_page"
t.string "browser"
t.string "os"
t.string "device_type"
t.string "country"
t.string "region"
t.string "city"
t.float "latitude"
t.float "longitude"
t.string "utm_source"
t.string "utm_medium"
t.string "utm_term"
t.string "utm_content"
t.string "utm_campaign"
t.string "app_version"
t.string "os_version"
t.string "platform"
t.datetime "started_at"
t.index ["user_id"], name: "index_ahoy_visits_on_user_id"
t.index ["visit_token"], name: "index_ahoy_visits_on_visit_token", unique: true
end
create_table "pay_charges", force: :cascade do |t|
t.integer "customer_id", null: false
t.integer "subscription_id"
t.string "processor_id", null: false
t.integer "amount", null: false
t.string "currency"
t.integer "application_fee_amount"
t.integer "amount_refunded"
t.json "metadata"
t.json "data"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["customer_id", "processor_id"], name: "index_pay_charges_on_customer_id_and_processor_id", unique: true
t.index ["subscription_id"], name: "index_pay_charges_on_subscription_id"
end
create_table "pay_customers", force: :cascade do |t|
t.string "owner_type"
t.integer "owner_id"
t.string "processor", null: false
t.string "processor_id"
t.boolean "default"
t.json "data"
t.datetime "deleted_at", precision: nil
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["owner_type", "owner_id", "deleted_at", "default"], name: "pay_customer_owner_index"
t.index ["processor", "processor_id"], name: "index_pay_customers_on_processor_and_processor_id", unique: true
end
create_table "pay_merchants", force: :cascade do |t|
t.string "owner_type"
t.integer "owner_id"
t.string "processor", null: false
t.string "processor_id"
t.boolean "default"
t.json "data"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["owner_type", "owner_id", "processor"], name: "index_pay_merchants_on_owner_type_and_owner_id_and_processor"
end
create_table "pay_payment_methods", force: :cascade do |t|
t.integer "customer_id", null: false
t.string "processor_id", null: false
t.boolean "default"
t.string "type"
t.json "data"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["customer_id", "processor_id"], name: "index_pay_payment_methods_on_customer_id_and_processor_id", unique: true
end
create_table "pay_subscriptions", force: :cascade do |t|
t.integer "customer_id", null: false
t.string "name", null: false
t.string "processor_id", null: false
t.string "processor_plan", null: false
t.integer "quantity", default: 1, null: false
t.string "status", null: false
t.datetime "current_period_start", precision: nil
t.datetime "current_period_end", precision: nil
t.datetime "trial_ends_at", precision: nil
t.datetime "ends_at", precision: nil
t.boolean "metered"
t.string "pause_behavior"
t.datetime "pause_starts_at", precision: nil
t.datetime "pause_resumes_at", precision: nil
t.decimal "application_fee_percent", precision: 8, scale: 2
t.json "metadata"
t.json "data"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["customer_id", "processor_id"], name: "index_pay_subscriptions_on_customer_id_and_processor_id", unique: true
t.index ["metered"], name: "index_pay_subscriptions_on_metered"
t.index ["pause_starts_at"], name: "index_pay_subscriptions_on_pause_starts_at"
end
create_table "pay_webhooks", force: :cascade do |t|
t.string "processor"
t.string "event_type"
t.json "event"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "users", force: :cascade do |t|
t.string "email"
t.string "name"
t.string "first_name"
t.string "last_name"
t.string "pay_customer_name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "ahoy_visit_id"
t.index ["ahoy_visit_id"], name: "index_users_on_ahoy_visit_id"
end
add_foreign_key "pay_charges", "pay_customers", column: "customer_id"
add_foreign_key "pay_charges", "pay_subscriptions", column: "subscription_id"
add_foreign_key "pay_payment_methods", "pay_customers", column: "customer_id"
add_foreign_key "pay_subscriptions", "pay_customers", column: "customer_id"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment