Inkline
Menu

Billing schema

Templates
Billing schema 3 items and 2 connections. customersPKiduuidUQemailtextnametext subscriptionsPKiduuidFKcustomer_iduuidplantextstarted_attimestamptz invoicesPKiduuidFKsubscription_iduuidamountnumeric(12,2)currencytext
Billing schema — preview
ERD

Customers, subscriptions and invoices with keys and one-to-many relations.

What is inside

  • 3 tables
  • Primary and foreign keys
  • Money as numeric(12,2)
Use this template

Opens in the playground, no account needed. Sign up to save it.

Show the Inkline text
diagram erd "Billing schema"
  table customers { id uuid pk; email text unique; name text }
  table subscriptions {
    id          uuid pk
    customer_id uuid fk
    plan        text
    started_at  timestamptz
  }
  table invoices {
    id              uuid pk
    subscription_id uuid fk
    amount          numeric(12,2)
    currency        text
  }

  customers.id -< subscriptions.customer_id
  subscriptions.id -< invoices.subscription_id