Shopify — Database Diagram

scroll = zoom · drag = pan · click a table
Shopify — Database Diagram LEGEND Area: Identity Area: Merchant Area: Tenant Area: Billing Reference Tables [Static] Entity Tables "Important" Tables Cross-Reference Tables Other Tables users shops plans invoices plan_addons subscriptions other foreign keys IDENTITY USERS STAFF ADMINS MERCHANT PLANS ADDONS TENANT CORE BILLING SUBSCRIPTIONS INVOICES PAYMENTS users idPK bigint not null uuidUQ uuid not null emailUQ varchar(255) not null password_hash varchar(255) not null user_sessions idPK bigint not null user_idFK bigint not null shop_id bigint not null token_hashUQ varchar(64) not null expires_at timestamp not null staff_roles idPK bigint not null shop_id bigint not null name varchar(100) not null shop_staff idPK bigint not null shop_id bigint not null user_idFK bigint not null role_idFK bigint staff_type staff_type not null is_owner boolean not null staff_invitations idPK bigint not null shop_id bigint not null email varchar(255) not null token_hashUQ varchar(64) not null expires_at timestamp not null platform_admins idPK bigint not null emailUQ varchar(255) not null password_hash varchar(255) not null full_name varchar(100) not null plans idPK bigint not null slugUQ varchar(100) not null name varchar(100) not null is_deprecated boolean not null plan_entitlements idPK bigint not null plan_idFK bigint not null key varchar(100) not null value varchar(255) not null plan_prices idPK bigint not null plan_idFK bigint not null currency char(3) not null monthly_cents int not null annual_cents int not null plan_addons idPK bigint not null keyUQ varchar(100) not null name varchar(100) not null plan_addon_prices idPK bigint not null plan_addon_idFK bigint not null currency char(3) not null monthly_cents int not null shops idPK bigint not null uuidUQ uuid not null name varchar(255) not null subdomainUQ varchar(100) not null status shop_status not null shop_settings idPK bigint not null shop_idFK bigint not null key varchar(100) not null value text shop_notes idPK bigint not null shop_idFK bigint not null body text not null created_byFK bigint subscriptions idPK bigint not null shop_idFK bigint not null plan_idFK bigint not null status subscription_status not null trial_ends_at timestamp current_period_ends_at timestamp not null plan_change_histories idPK bigint not null shop_idFK bigint not null from_plan_idFK bigint to_plan_idFK bigint not null subscription_addons idPK bigint not null subscription_idFK bigint not null plan_addon_idFK bigint not null quantity int not null invoices idPK bigint not null shop_idFK bigint not null subscription_idFK bigint status invoice_status not null total_cents int not null due_at date invoice_line_items idPK bigint not null invoice_idFK bigint not null description varchar(255) not null amount_cents int not null transactions idPK bigint not null invoice_idFK bigint not null amount_cents int not null currency char(3) not null payment_retry_attempts idPK bigint not null invoice_idFK bigint not null attempt_number int not null scheduled_at timestamp not null payment_methods idPK bigint not null shop_idFK bigint not null is_default boolean not null provider varchar(50) not null last4 char(4) billing_usages idPK bigint not null shop_idFK bigint not null metric varchar(100) not null quantity bigint not null shop_credits idPK bigint not null shop_idFK bigint not null amount_cents int not null balance_after_cents int not null