Skip to main content

Large schema

Generated-looking multi-tenant SaaS schema (~60 tables) for layout and render performance tests. Plain public schema, inline refs, table groups with colors.

Covers: 61-table multi-tenant SaaS schema (tenancy, identity, billing, work tracking, content, platform, analytics) with 94 refs, 7 colored table groups and 2 views, for layout and rendering performance

14-large.dbml
14-large.dbmltenancytenancyidentityidentitybillingbillingworkworkcontentcontentplatformplatformanalyticsanalyticspublic.organizations.id < public.workspaces.organization_idpublic.users.id < public.user_identities.user_idpublic.users.id < public.user_sessions.user_idpublic.workspaces.id < public.api_tokens.workspace_idpublic.users.id < public.api_tokens.created_bypublic.organizations.id < public.memberships.organization_idpublic.users.id < public.memberships.user_idpublic.roles.id < public.memberships.role_idpublic.organizations.id < public.roles.organization_idpublic.roles.id < public.role_permissions.role_idpublic.permissions.id < public.role_permissions.permission_idpublic.organizations.id < public.invitations.organization_idpublic.users.id < public.invitations.invited_bypublic.roles.id < public.invitations.role_idpublic.workspaces.id < public.teams.workspace_idpublic.teams.id < public.team_members.team_idpublic.users.id < public.team_members.user_idpublic.plans.id < public.plan_features.plan_idpublic.organizations.id < public.subscriptions.organization_idpublic.plans.id < public.subscriptions.plan_idpublic.subscriptions.id < public.subscription_items.subscription_idpublic.organizations.id < public.invoices.organization_idpublic.subscriptions.id < public.invoices.subscription_idpublic.invoices.id < public.invoice_lines.invoice_idpublic.organizations.id < public.payment_methods.organization_idpublic.invoices.id < public.payments.invoice_idpublic.payment_methods.id < public.payments.payment_method_idpublic.payments.id < public.refunds.payment_idpublic.coupons.id < public.coupon_redemptions.coupon_idpublic.subscriptions.id < public.coupon_redemptions.subscription_idpublic.subscription_items.id < public.usage_records.subscription_item_idpublic.workspaces.id < public.projects.workspace_idpublic.users.id < public.projects.owner_idpublic.projects.id < public.project_members.project_idpublic.users.id < public.project_members.user_idpublic.projects.id < public.boards.project_idpublic.boards.id < public.board_columns.board_idpublic.projects.id < public.milestones.project_idpublic.projects.id < public.issues.project_idpublic.board_columns.id < public.issues.column_idpublic.milestones.id < public.issues.milestone_idpublic.users.id < public.issues.reporter_idpublic.users.id < public.issues.assignee_idpublic.issues.id < public.issues.parent_idpublic.issues.id < public.issue_comments.issue_idpublic.users.id < public.issue_comments.author_idpublic.projects.id < public.labels.project_idpublic.issues.id < public.issue_labels.issue_idpublic.labels.id < public.issue_labels.label_idpublic.issues.id < public.issue_links.source_issue_idpublic.issues.id < public.issue_links.target_issue_idpublic.issues.id < public.issue_watchers.issue_idpublic.users.id < public.issue_watchers.user_idpublic.issues.id < public.time_entries.issue_idpublic.users.id < public.time_entries.user_idpublic.boards.id < public.sprints.board_idpublic.sprints.id < public.sprint_issues.sprint_idpublic.issues.id < public.sprint_issues.issue_idpublic.projects.id < public.custom_fields.project_idpublic.custom_fields.id < public.custom_field_values.custom_field_idpublic.issues.id < public.custom_field_values.issue_idpublic.workspaces.id < public.documents.workspace_idpublic.users.id < public.documents.author_idpublic.documents.id < public.documents.parent_idpublic.documents.id < public.document_versions.document_idpublic.users.id < public.document_versions.author_idpublic.workspaces.id < public.attachments.workspace_idpublic.users.id < public.attachments.uploaded_bypublic.issues.id < public.attachments.issue_idpublic.documents.id < public.attachments.document_idpublic.users.id < public.reactions.user_idpublic.issue_comments.id < public.reactions.comment_idpublic.issue_comments.id < public.mentions.comment_idpublic.users.id < public.mentions.mentioned_user_idpublic.users.id < public.notifications.user_idpublic.users.id < public.notification_preferences.user_idpublic.workspaces.id < public.integrations.workspace_idpublic.users.id < public.integrations.installed_bypublic.workspaces.id < public.webhooks.workspace_idpublic.webhooks.id < public.webhook_deliveries.webhook_idpublic.organizations.id < public.audit_events.organization_idpublic.users.id < public.audit_events.actor_idpublic.feature_flags.id < public.feature_flag_overrides.feature_flag_idpublic.organizations.id < public.feature_flag_overrides.organization_idpublic.users.id < public.saved_views.user_idpublic.projects.id < public.saved_views.project_idpublic.workspaces.id < public.search_index_jobs.workspace_idpublic.workspaces.id < public.exports.workspace_idpublic.users.id < public.exports.requested_bypublic.workspaces.id < public.imports.workspace_idpublic.users.id < public.imports.requested_bypublic.organizations.id < public.daily_active_users.organization_idpublic.issues.id < public.issue_metrics.issue_idpublic.organizations.plan_id > public.plans.id delete: set nullorganizations Top-level tenantorganizationshas noteid bigint · primary key · incrementidbigintname varchar(200) · not nullnameNNvarchar(200)slug varchar(80) · unique · not nullslugUNNvarchar(80)plan_id bigint · foreign keyplan_idbigintregion varchar(16) · not null · default: eu-west-1regionNNvarchar(16)created_at timestamptz · not null · default: now()created_atNNtimestamptzupdated_at timestamptzupdated_attimestamptzworkspacesworkspacesid bigint · primary key · incrementidbigintorganization_id bigint · foreign key · not nullorganization_idNNbigintname varchar(200) · not nullnameNNvarchar(200)is_default boolean · not null · default: falseis_defaultNNbooleancreated_at timestamptz · not null · default: now()created_atNNtimestamptzupdated_at timestamptzupdated_attimestamptzusersusersid bigint · primary key · incrementidbigintemail varchar(320) · unique · not nullemailUNNvarchar(320)full_name varchar(200)full_namevarchar(200)locale varchar(10) · default: enlocalevarchar(10)last_seen_at timestamptzlast_seen_attimestamptzcreated_at timestamptz · not null · default: now()created_atNNtimestamptzupdated_at timestamptzupdated_attimestamptzuser_identitiesuser_identitiesid bigint · primary key · incrementidbigintuser_id bigint · foreign key · not nulluser_idNNbigintprovider varchar(32) · not nullproviderNNvarchar(32)subject varchar(255) · not nullsubjectNNvarchar(255)created_at timestamptz · not null · default: now()created_atNNtimestamptzupdated_at timestamptzupdated_attimestamptzuser_sessionsuser_sessionsid bigint · primary key · incrementidbigintuser_id bigint · foreign key · not nulluser_idNNbigintip inetipinetuser_agent textuser_agenttextexpires_at timestamptz · not nullexpires_atNNtimestamptzcreated_at timestamptz · not null · default: now()created_atNNtimestamptzapi_tokensapi_tokensid bigint · primary key · incrementidbigintworkspace_id bigint · foreign key · not nullworkspace_idNNbigintcreated_by bigint · foreign key · not nullcreated_byNNbigintname varchar(100) · not nullnameNNvarchar(100)token_hash char(64) · unique · not nulltoken_hashUNNchar(64)last_used_at timestamptzlast_used_attimestamptzrevoked_at timestamptzrevoked_attimestamptzcreated_at timestamptz · not null · default: now()created_atNNtimestamptzupdated_at timestamptzupdated_attimestamptzmembershipsmembershipsorganization_id bigint · foreign key · not nullorganization_idNNbigintuser_id bigint · foreign key · not nulluser_idNNbigintrole_id bigint · foreign key · not nullrole_idNNbigintjoined_at timestamptz · not null · default: now()joined_atNNtimestamptzrolesrolesid bigint · primary key · incrementidbigintorganization_id bigint · foreign keyorganization_idbigintname varchar(64) · not nullnameNNvarchar(64)is_system boolean · not null · default: falseis_systemNNbooleancreated_at timestamptz · not null · default: now()created_atNNtimestamptzupdated_at timestamptzupdated_attimestamptzpermissionspermissionsid bigint · primary key · incrementidbigintcode varchar(100) · unique · not nullcodeUNNvarchar(100)description textdescriptiontextrole_permissionsrole_permissionsrole_id bigint · foreign key · not nullrole_idNNbigintpermission_id bigint · foreign key · not nullpermission_idNNbigintinvitationsinvitationsid bigint · primary key · incrementidbigintorganization_id bigint · foreign key · not nullorganization_idNNbigintinvited_by bigint · foreign key · not nullinvited_byNNbigintrole_id bigint · foreign key · not nullrole_idNNbigintemail varchar(320) · not nullemailNNvarchar(320)token char(32) · unique · not nulltokenUNNchar(32)accepted_at timestamptzaccepted_attimestamptzexpires_at timestamptz · not nullexpires_atNNtimestamptzcreated_at timestamptz · not null · default: now()created_atNNtimestamptzupdated_at timestamptzupdated_attimestamptzteamsteamsid bigint · primary key · incrementidbigintworkspace_id bigint · foreign key · not nullworkspace_idNNbigintname varchar(100) · not nullnameNNvarchar(100)created_at timestamptz · not null · default: now()created_atNNtimestamptzupdated_at timestamptzupdated_attimestamptzteam_membersteam_membersteam_id bigint · foreign key · not nullteam_idNNbigintuser_id bigint · foreign key · not nulluser_idNNbigintplansplansid bigint · primary key · incrementidbigintcode varchar(32) · unique · not nullcodeUNNvarchar(32)name varchar(100) · not nullnameNNvarchar(100)monthly_price_cents integer · not nullmonthly_price_centsNNintegerseat_limit integerseat_limitintegeris_public boolean · not null · default: trueis_publicNNbooleanplan_featuresplan_featuresid bigint · primary key · incrementidbigintplan_id bigint · foreign key · not nullplan_idNNbigintfeature_key varchar(64) · not nullfeature_keyNNvarchar(64)limit_value integerlimit_valueintegersubscriptionssubscriptionsid bigint · primary key · incrementidbigintorganization_id bigint · foreign key · not nullorganization_idNNbigintplan_id bigint · foreign key · not nullplan_idNNbigintstatus varchar(20) · not nullstatusNNvarchar(20)seats integer · not null · default: 1seatsNNintegercurrent_period_end timestamptzcurrent_period_endtimestamptzcanceled_at timestamptzcanceled_attimestamptzcreated_at timestamptz · not null · default: now()created_atNNtimestamptzupdated_at timestamptzupdated_attimestamptzsubscription_itemssubscription_itemsid bigint · primary key · incrementidbigintsubscription_id bigint · foreign key · not nullsubscription_idNNbigintprice_code varchar(64) · not nullprice_codeNNvarchar(64)quantity integer · not null · default: 1quantityNNintegerinvoicesinvoicesid bigint · primary key · incrementidbigintorganization_id bigint · foreign key · not nullorganization_idNNbigintsubscription_id bigint · foreign keysubscription_idbigintnumber varchar(32) · unique · not nullnumberUNNvarchar(32)status varchar(20) · not nullstatusNNvarchar(20)total_cents bigint · not nulltotal_centsNNbigintcurrency char(3) · not null · default: EURcurrencyNNchar(3)issued_at timestamptzissued_attimestamptzdue_at timestamptzdue_attimestamptzinvoice_linesinvoice_linesid bigint · primary key · incrementidbigintinvoice_id bigint · foreign key · not nullinvoice_idNNbigintdescription varchar(300) · not nulldescriptionNNvarchar(300)quantity integer · not nullquantityNNintegerunit_amount_cents bigint · not nullunit_amount_centsNNbigintpayment_methodspayment_methodsid bigint · primary key · incrementidbigintorganization_id bigint · foreign key · not nullorganization_idNNbigintkind varchar(20) · not nullkindNNvarchar(20)brand varchar(20)brandvarchar(20)last4 char(4)last4char(4)is_default boolean · not null · default: falseis_defaultNNbooleancreated_at timestamptz · not null · default: now()created_atNNtimestamptzupdated_at timestamptzupdated_attimestamptzpaymentspaymentsid bigint · primary key · incrementidbigintinvoice_id bigint · foreign key · not nullinvoice_idNNbigintpayment_method_id bigint · foreign keypayment_method_idbigintamount_cents bigint · not nullamount_centsNNbigintstatus varchar(20) · not nullstatusNNvarchar(20)provider_ref varchar(100)provider_refvarchar(100)paid_at timestamptzpaid_attimestamptzrefundsrefundsid bigint · primary key · incrementidbigintpayment_id bigint · foreign key · not nullpayment_idNNbigintamount_cents bigint · not nullamount_centsNNbigintreason textreasontextcreated_at timestamptz · not null · default: now()created_atNNtimestamptzcouponscouponsid bigint · primary key · incrementidbigintcode varchar(32) · unique · not nullcodeUNNvarchar(32)percent_off smallintpercent_offsmallintamount_off_cents bigintamount_off_centsbigintvalid_until timestamptzvalid_untiltimestamptzcoupon_redemptionscoupon_redemptionsid bigint · primary key · incrementidbigintcoupon_id bigint · foreign key · not nullcoupon_idNNbigintsubscription_id bigint · foreign key · not nullsubscription_idNNbigintredeemed_at timestamptz · not null · default: now()redeemed_atNNtimestamptzusage_recordsusage_recordsid bigint · primary key · incrementidbigintsubscription_item_id bigint · foreign key · not nullsubscription_item_idNNbigintquantity bigint · not nullquantityNNbigintrecorded_at timestamptz · not nullrecorded_atNNtimestamptztax_ratestax_ratesid bigint · primary key · incrementidbigintcountry char(2) · not nullcountryNNchar(2)region varchar(10)regionvarchar(10)percentage decimal(5,2) · not nullpercentageNNdecimal(5,2)projectsprojectsid bigint · primary key · incrementidbigintworkspace_id bigint · foreign key · not nullworkspace_idNNbigintowner_id bigint · foreign key · not nullowner_idNNbigintkey varchar(10) · not nullkeyNNvarchar(10)name varchar(200) · not nullnameNNvarchar(200)archived_at timestamptzarchived_attimestamptzcreated_at timestamptz · not null · default: now()created_atNNtimestamptzupdated_at timestamptzupdated_attimestamptzproject_membersproject_membersproject_id bigint · foreign key · not nullproject_idNNbigintuser_id bigint · foreign key · not nulluser_idNNbigintaccess varchar(10) · not null · default: writeaccessNNvarchar(10)boardsboardsid bigint · primary key · incrementidbigintproject_id bigint · foreign key · not nullproject_idNNbigintname varchar(100) · not nullnameNNvarchar(100)position integer · not null · default: 0positionNNintegerboard_columnsboard_columnsid bigint · primary key · incrementidbigintboard_id bigint · foreign key · not nullboard_idNNbigintname varchar(100) · not nullnameNNvarchar(100)position integer · not nullpositionNNintegerwip_limit integerwip_limitintegermilestonesmilestonesid bigint · primary key · incrementidbigintproject_id bigint · foreign key · not nullproject_idNNbiginttitle varchar(200) · not nulltitleNNvarchar(200)due_on datedue_ondateclosed_at timestamptzclosed_attimestamptzissues Core work itemissueshas noteid bigint · primary key · incrementidbigintproject_id bigint · foreign key · not nullproject_idNNbigintcolumn_id bigint · foreign keycolumn_idbigintmilestone_id bigint · foreign keymilestone_idbigintreporter_id bigint · foreign key · not nullreporter_idNNbigintassignee_id bigint · foreign keyassignee_idbigintparent_id bigint · foreign keyparent_idbigintnumber integer · not nullnumberNNintegertitle varchar(300) · not nulltitleNNvarchar(300)description textdescriptiontextpriority smallint · not null · default: 3priorityNNsmallintestimate_points smallintestimate_pointssmallintclosed_at timestamptzclosed_attimestamptzcreated_at timestamptz · not null · default: now()created_atNNtimestamptzupdated_at timestamptzupdated_attimestamptzissue_commentsissue_commentsid bigint · primary key · incrementidbigintissue_id bigint · foreign key · not nullissue_idNNbigintauthor_id bigint · foreign key · not nullauthor_idNNbigintbody text · not nullbodyNNtextcreated_at timestamptz · not null · default: now()created_atNNtimestamptzupdated_at timestamptzupdated_attimestamptzlabelslabelsid bigint · primary key · incrementidbigintproject_id bigint · foreign key · not nullproject_idNNbigintname varchar(50) · not nullnameNNvarchar(50)color char(7) · not null · default: #cccccccolorNNchar(7)issue_labelsissue_labelsissue_id bigint · foreign key · not nullissue_idNNbigintlabel_id bigint · foreign key · not nulllabel_idNNbigintissue_linksissue_linksid bigint · primary key · incrementidbigintsource_issue_id bigint · foreign key · not nullsource_issue_idNNbiginttarget_issue_id bigint · foreign key · not nulltarget_issue_idNNbigintkind varchar(20) · not nullkindNNvarchar(20)issue_watchersissue_watchersissue_id bigint · foreign key · not nullissue_idNNbigintuser_id bigint · foreign key · not nulluser_idNNbiginttime_entriestime_entriesid bigint · primary key · incrementidbigintissue_id bigint · foreign key · not nullissue_idNNbigintuser_id bigint · foreign key · not nulluser_idNNbigintminutes integer · not nullminutesNNintegerspent_on date · not nullspent_onNNdatenote textnotetextsprintssprintsid bigint · primary key · incrementidbigintboard_id bigint · foreign key · not nullboard_idNNbigintname varchar(100) · not nullnameNNvarchar(100)starts_on date · not nullstarts_onNNdateends_on date · not nullends_onNNdatesprint_issuessprint_issuessprint_id bigint · foreign key · not nullsprint_idNNbigintissue_id bigint · foreign key · not nullissue_idNNbigintcustom_fieldscustom_fieldsid bigint · primary key · incrementidbigintproject_id bigint · foreign key · not nullproject_idNNbigintname varchar(100) · not nullnameNNvarchar(100)field_type varchar(20) · not nullfield_typeNNvarchar(20)custom_field_valuescustom_field_valuesid bigint · primary key · incrementidbigintcustom_field_id bigint · foreign key · not nullcustom_field_idNNbigintissue_id bigint · foreign key · not nullissue_idNNbigintvalue_text textvalue_texttextvalue_number numericvalue_numbernumericdocumentsdocumentsid bigint · primary key · incrementidbigintworkspace_id bigint · foreign key · not nullworkspace_idNNbigintauthor_id bigint · foreign key · not nullauthor_idNNbigintparent_id bigint · foreign keyparent_idbiginttitle varchar(300) · not nulltitleNNvarchar(300)body jsonbbodyjsonbpublished_at timestamptzpublished_attimestamptzcreated_at timestamptz · not null · default: now()created_atNNtimestamptzupdated_at timestamptzupdated_attimestamptzdocument_versionsdocument_versionsid bigint · primary key · incrementidbigintdocument_id bigint · foreign key · not nulldocument_idNNbigintauthor_id bigint · foreign key · not nullauthor_idNNbigintversion integer · not nullversionNNintegerbody jsonb · not nullbodyNNjsonbcreated_at timestamptz · not null · default: now()created_atNNtimestamptzattachmentsattachmentsid bigint · primary key · incrementidbigintworkspace_id bigint · foreign key · not nullworkspace_idNNbigintuploaded_by bigint · foreign key · not nulluploaded_byNNbigintissue_id bigint · foreign keyissue_idbigintdocument_id bigint · foreign keydocument_idbigintfile_name varchar(255) · not nullfile_nameNNvarchar(255)content_type varchar(100)content_typevarchar(100)size_bytes bigint · not nullsize_bytesNNbigintstorage_key varchar(500) · unique · not nullstorage_keyUNNvarchar(500)created_at timestamptz · not null · default: now()created_atNNtimestamptzreactionsreactionsid bigint · primary key · incrementidbigintuser_id bigint · foreign key · not nulluser_idNNbigintcomment_id bigint · foreign key · not nullcomment_idNNbigintemoji varchar(32) · not nullemojiNNvarchar(32)mentionsmentionsid bigint · primary key · incrementidbigintcomment_id bigint · foreign key · not nullcomment_idNNbigintmentioned_user_id bigint · foreign key · not nullmentioned_user_idNNbigintnotified boolean · not null · default: falsenotifiedNNbooleannotificationsnotificationsid bigint · primary key · incrementidbigintuser_id bigint · foreign key · not nulluser_idNNbigintkind varchar(40) · not nullkindNNvarchar(40)payload jsonb · not nullpayloadNNjsonbread_at timestamptzread_attimestamptzcreated_at timestamptz · not null · default: now()created_atNNtimestamptznotification_preferencesnotification_preferencesid bigint · primary key · incrementidbigintuser_id bigint · foreign key · not nulluser_idNNbigintchannel varchar(20) · not nullchannelNNvarchar(20)kind varchar(40) · not nullkindNNvarchar(40)enabled boolean · not null · default: trueenabledNNbooleanintegrationsintegrationsid bigint · primary key · incrementidbigintworkspace_id bigint · foreign key · not nullworkspace_idNNbigintinstalled_by bigint · foreign key · not nullinstalled_byNNbigintprovider varchar(40) · not nullproviderNNvarchar(40)config jsonbconfigjsonbstatus varchar(20) · not null · default: activestatusNNvarchar(20)created_at timestamptz · not null · default: now()created_atNNtimestamptzupdated_at timestamptzupdated_attimestamptzwebhookswebhooksid bigint · primary key · incrementidbigintworkspace_id bigint · foreign key · not nullworkspace_idNNbiginturl varchar(1000) · not nullurlNNvarchar(1000)secret char(32) · not nullsecretNNchar(32)events text[]eventstext[]is_active boolean · not null · default: trueis_activeNNbooleancreated_at timestamptz · not null · default: now()created_atNNtimestamptzupdated_at timestamptzupdated_attimestamptzwebhook_deliverieswebhook_deliveriesid bigint · primary key · incrementidbigintwebhook_id bigint · foreign key · not nullwebhook_idNNbigintevent varchar(64) · not nulleventNNvarchar(64)status_code smallintstatus_codesmallintattempt smallint · not null · default: 1attemptNNsmallintdelivered_at timestamptzdelivered_attimestamptzaudit_eventsaudit_eventsid bigint · primary key · incrementidbigintorganization_id bigint · foreign key · not nullorganization_idNNbigintactor_id bigint · foreign keyactor_idbigintaction varchar(100) · not nullactionNNvarchar(100)target_type varchar(50)target_typevarchar(50)target_id biginttarget_idbigintip inetipinetoccurred_at timestamptz · not null · default: now()occurred_atNNtimestamptzfeature_flagsfeature_flagsid bigint · primary key · incrementidbigintkey varchar(100) · unique · not nullkeyUNNvarchar(100)description textdescriptiontextrollout_percent smallint · not null · default: 0rollout_percentNNsmallintfeature_flag_overridesfeature_flag_overridesid bigint · primary key · incrementidbigintfeature_flag_id bigint · foreign key · not nullfeature_flag_idNNbigintorganization_id bigint · foreign key · not nullorganization_idNNbigintenabled boolean · not nullenabledNNbooleansaved_viewssaved_viewsid bigint · primary key · incrementidbigintuser_id bigint · foreign key · not nulluser_idNNbigintproject_id bigint · foreign key · not nullproject_idNNbigintname varchar(100) · not nullnameNNvarchar(100)filters jsonb · not nullfiltersNNjsonbsearch_index_jobssearch_index_jobsid bigint · primary key · incrementidbigintworkspace_id bigint · foreign key · not nullworkspace_idNNbigintstatus varchar(20) · not nullstatusNNvarchar(20)started_at timestamptzstarted_attimestamptzfinished_at timestamptzfinished_attimestamptzexportsexportsid bigint · primary key · incrementidbigintworkspace_id bigint · foreign key · not nullworkspace_idNNbigintrequested_by bigint · foreign key · not nullrequested_byNNbigintformat varchar(10) · not nullformatNNvarchar(10)status varchar(20) · not nullstatusNNvarchar(20)storage_key varchar(500)storage_keyvarchar(500)created_at timestamptz · not null · default: now()created_atNNtimestamptzimportsimportsid bigint · primary key · incrementidbigintworkspace_id bigint · foreign key · not nullworkspace_idNNbigintrequested_by bigint · foreign key · not nullrequested_byNNbigintsource varchar(40) · not nullsourceNNvarchar(40)status varchar(20) · not nullstatusNNvarchar(20)error texterrortextcreated_at timestamptz · not null · default: now()created_atNNtimestamptzdaily_active_usersdaily_active_usersday datedaydateorganization_id bigint · foreign keyorganization_idbigintusers integer · not nullusersNNintegerissue_metricsissue_metricsissue_id bigint · primary key · foreign keyissue_idbigintcycle_time_hours numericcycle_time_hoursnumericreopened_count smallint · not null · default: 0reopened_countNNsmallint

View: billing_only​

A DiagramView shows a subset of the schema. Pass view="billing_only" (or pick it in the toolbar's view menu) to start there:

billing_only
billing_onlybillingbillingpublic.plans.id < public.plan_features.plan_idpublic.plans.id < public.subscriptions.plan_idpublic.subscriptions.id < public.subscription_items.subscription_idpublic.subscriptions.id < public.invoices.subscription_idpublic.invoices.id < public.invoice_lines.invoice_idpublic.invoices.id < public.payments.invoice_idpublic.payment_methods.id < public.payments.payment_method_idpublic.payments.id < public.refunds.payment_idpublic.coupons.id < public.coupon_redemptions.coupon_idpublic.subscriptions.id < public.coupon_redemptions.subscription_idpublic.subscription_items.id < public.usage_records.subscription_item_idplansplansid bigint · primary key · incrementidbigintcode varchar(32) · unique · not nullcodeUNNvarchar(32)name varchar(100) · not nullnameNNvarchar(100)monthly_price_cents integer · not nullmonthly_price_centsNNintegerseat_limit integerseat_limitintegeris_public boolean · not null · default: trueis_publicNNbooleanplan_featuresplan_featuresid bigint · primary key · incrementidbigintplan_id bigint · foreign key · not nullplan_idNNbigintfeature_key varchar(64) · not nullfeature_keyNNvarchar(64)limit_value integerlimit_valueintegersubscriptionssubscriptionsid bigint · primary key · incrementidbigintorganization_id bigint · foreign key · not nullorganization_idNNbigintplan_id bigint · foreign key · not nullplan_idNNbigintstatus varchar(20) · not nullstatusNNvarchar(20)seats integer · not null · default: 1seatsNNintegercurrent_period_end timestamptzcurrent_period_endtimestamptzcanceled_at timestamptzcanceled_attimestamptzcreated_at timestamptz · not null · default: now()created_atNNtimestamptzupdated_at timestamptzupdated_attimestamptzsubscription_itemssubscription_itemsid bigint · primary key · incrementidbigintsubscription_id bigint · foreign key · not nullsubscription_idNNbigintprice_code varchar(64) · not nullprice_codeNNvarchar(64)quantity integer · not null · default: 1quantityNNintegerinvoicesinvoicesid bigint · primary key · incrementidbigintorganization_id bigint · foreign key · not nullorganization_idNNbigintsubscription_id bigint · foreign keysubscription_idbigintnumber varchar(32) · unique · not nullnumberUNNvarchar(32)status varchar(20) · not nullstatusNNvarchar(20)total_cents bigint · not nulltotal_centsNNbigintcurrency char(3) · not null · default: EURcurrencyNNchar(3)issued_at timestamptzissued_attimestamptzdue_at timestamptzdue_attimestamptzinvoice_linesinvoice_linesid bigint · primary key · incrementidbigintinvoice_id bigint · foreign key · not nullinvoice_idNNbigintdescription varchar(300) · not nulldescriptionNNvarchar(300)quantity integer · not nullquantityNNintegerunit_amount_cents bigint · not nullunit_amount_centsNNbigintpayment_methodspayment_methodsid bigint · primary key · incrementidbigintorganization_id bigint · foreign key · not nullorganization_idNNbigintkind varchar(20) · not nullkindNNvarchar(20)brand varchar(20)brandvarchar(20)last4 char(4)last4char(4)is_default boolean · not null · default: falseis_defaultNNbooleancreated_at timestamptz · not null · default: now()created_atNNtimestamptzupdated_at timestamptzupdated_attimestamptzpaymentspaymentsid bigint · primary key · incrementidbigintinvoice_id bigint · foreign key · not nullinvoice_idNNbigintpayment_method_id bigint · foreign keypayment_method_idbigintamount_cents bigint · not nullamount_centsNNbigintstatus varchar(20) · not nullstatusNNvarchar(20)provider_ref varchar(100)provider_refvarchar(100)paid_at timestamptzpaid_attimestamptzrefundsrefundsid bigint · primary key · incrementidbigintpayment_id bigint · foreign key · not nullpayment_idNNbigintamount_cents bigint · not nullamount_centsNNbigintreason textreasontextcreated_at timestamptz · not null · default: now()created_atNNtimestamptzcouponscouponsid bigint · primary key · incrementidbigintcode varchar(32) · unique · not nullcodeUNNvarchar(32)percent_off smallintpercent_offsmallintamount_off_cents bigintamount_off_centsbigintvalid_until timestamptzvalid_untiltimestamptzcoupon_redemptionscoupon_redemptionsid bigint · primary key · incrementidbigintcoupon_id bigint · foreign key · not nullcoupon_idNNbigintsubscription_id bigint · foreign key · not nullsubscription_idNNbigintredeemed_at timestamptz · not null · default: now()redeemed_atNNtimestamptzusage_recordsusage_recordsid bigint · primary key · incrementidbigintsubscription_item_id bigint · foreign key · not nullsubscription_item_idNNbigintquantity bigint · not nullquantityNNbigintrecorded_at timestamptz · not nullrecorded_atNNtimestamptztax_ratestax_ratesid bigint · primary key · incrementidbigintcountry char(2) · not nullcountryNNchar(2)region varchar(10)regionvarchar(10)percentage decimal(5,2) · not nullpercentageNNdecimal(5,2)

Source​

examples/14-large.dbml
examples/14-large.dbml
// Generated-looking multi-tenant SaaS schema (~60 tables) for layout and render
// performance tests. Plain public schema, inline refs, table groups with colors.

Project saas_large {
database_type: 'PostgreSQL'
Note: 'Synthetic SaaS schema for layout performance.'
}

Table organizations {
id bigint [pk, increment]
name varchar(200) [not null]
slug varchar(80) [not null, unique]
plan_id bigint
region varchar(16) [not null, default: 'eu-west-1']
created_at timestamptz [not null, default: `now()`]
updated_at timestamptz

Note: 'Top-level tenant'
}

Table workspaces {
id bigint [pk, increment]
organization_id bigint [not null, ref: > organizations.id]
name varchar(200) [not null]
is_default boolean [not null, default: false]
created_at timestamptz [not null, default: `now()`]
updated_at timestamptz
}

Table users {
id bigint [pk, increment]
email varchar(320) [not null, unique]
full_name varchar(200)
locale varchar(10) [default: 'en']
last_seen_at timestamptz
created_at timestamptz [not null, default: `now()`]
updated_at timestamptz
}

Table user_identities {
id bigint [pk, increment]
user_id bigint [not null, ref: > users.id]
provider varchar(32) [not null]
subject varchar(255) [not null]
created_at timestamptz [not null, default: `now()`]
updated_at timestamptz
}

Table user_sessions {
id bigint [pk, increment]
user_id bigint [not null, ref: > users.id]
ip inet
user_agent text
expires_at timestamptz [not null]
created_at timestamptz [not null, default: `now()`]
}

Table api_tokens {
id bigint [pk, increment]
workspace_id bigint [not null, ref: > workspaces.id]
created_by bigint [not null, ref: > users.id]
name varchar(100) [not null]
token_hash char(64) [not null, unique]
last_used_at timestamptz
revoked_at timestamptz
created_at timestamptz [not null, default: `now()`]
updated_at timestamptz
}

Table memberships {
organization_id bigint [not null, ref: > organizations.id]
user_id bigint [not null, ref: > users.id]
role_id bigint [not null, ref: > roles.id]
joined_at timestamptz [not null, default: `now()`]
indexes {
(organization_id, user_id) [pk]
}
}

Table roles {
id bigint [pk, increment]
organization_id bigint [ref: > organizations.id]
name varchar(64) [not null]
is_system boolean [not null, default: false]
created_at timestamptz [not null, default: `now()`]
updated_at timestamptz
}

Table permissions {
id bigint [pk, increment]
code varchar(100) [not null, unique]
description text
}

Table role_permissions {
role_id bigint [not null, ref: > roles.id]
permission_id bigint [not null, ref: > permissions.id]
indexes {
(role_id, permission_id) [pk]
}
}

Table invitations {
id bigint [pk, increment]
organization_id bigint [not null, ref: > organizations.id]
invited_by bigint [not null, ref: > users.id]
role_id bigint [not null, ref: > roles.id]
email varchar(320) [not null]
token char(32) [not null, unique]
accepted_at timestamptz
expires_at timestamptz [not null]
created_at timestamptz [not null, default: `now()`]
updated_at timestamptz
}

Table teams {
id bigint [pk, increment]
workspace_id bigint [not null, ref: > workspaces.id]
name varchar(100) [not null]
created_at timestamptz [not null, default: `now()`]
updated_at timestamptz
}

Table team_members {
team_id bigint [not null, ref: > teams.id]
user_id bigint [not null, ref: > users.id]
indexes {
(team_id, user_id) [pk]
}
}

Table plans {
id bigint [pk, increment]
code varchar(32) [not null, unique]
name varchar(100) [not null]
monthly_price_cents integer [not null]
seat_limit integer
is_public boolean [not null, default: true]
}

Table plan_features {
id bigint [pk, increment]
plan_id bigint [not null, ref: > plans.id]
feature_key varchar(64) [not null]
limit_value integer
}

Table subscriptions {
id bigint [pk, increment]
organization_id bigint [not null, ref: > organizations.id]
plan_id bigint [not null, ref: > plans.id]
status varchar(20) [not null]
seats integer [not null, default: 1]
current_period_end timestamptz
canceled_at timestamptz
created_at timestamptz [not null, default: `now()`]
updated_at timestamptz
}

Table subscription_items {
id bigint [pk, increment]
subscription_id bigint [not null, ref: > subscriptions.id]
price_code varchar(64) [not null]
quantity integer [not null, default: 1]
}

Table invoices {
id bigint [pk, increment]
organization_id bigint [not null, ref: > organizations.id]
subscription_id bigint [ref: > subscriptions.id]
number varchar(32) [not null, unique]
status varchar(20) [not null]
total_cents bigint [not null]
currency char(3) [not null, default: 'EUR']
issued_at timestamptz
due_at timestamptz
}

Table invoice_lines {
id bigint [pk, increment]
invoice_id bigint [not null, ref: > invoices.id]
description varchar(300) [not null]
quantity integer [not null]
unit_amount_cents bigint [not null]
}

Table payment_methods {
id bigint [pk, increment]
organization_id bigint [not null, ref: > organizations.id]
kind varchar(20) [not null]
brand varchar(20)
last4 char(4)
is_default boolean [not null, default: false]
created_at timestamptz [not null, default: `now()`]
updated_at timestamptz
}

Table payments {
id bigint [pk, increment]
invoice_id bigint [not null, ref: > invoices.id]
payment_method_id bigint [ref: > payment_methods.id]
amount_cents bigint [not null]
status varchar(20) [not null]
provider_ref varchar(100)
paid_at timestamptz
}

Table refunds {
id bigint [pk, increment]
payment_id bigint [not null, ref: > payments.id]
amount_cents bigint [not null]
reason text
created_at timestamptz [not null, default: `now()`]
}

Table coupons {
id bigint [pk, increment]
code varchar(32) [not null, unique]
percent_off smallint
amount_off_cents bigint
valid_until timestamptz
}

Table coupon_redemptions {
id bigint [pk, increment]
coupon_id bigint [not null, ref: > coupons.id]
subscription_id bigint [not null, ref: > subscriptions.id]
redeemed_at timestamptz [not null, default: `now()`]
}

Table usage_records {
id bigint [pk, increment]
subscription_item_id bigint [not null, ref: > subscription_items.id]
quantity bigint [not null]
recorded_at timestamptz [not null]
}

Table tax_rates {
id bigint [pk, increment]
country char(2) [not null]
region varchar(10)
percentage "decimal(5,2)" [not null]
}

Table projects {
id bigint [pk, increment]
workspace_id bigint [not null, ref: > workspaces.id]
owner_id bigint [not null, ref: > users.id]
key varchar(10) [not null]
name varchar(200) [not null]
archived_at timestamptz
created_at timestamptz [not null, default: `now()`]
updated_at timestamptz
}

Table project_members {
project_id bigint [not null, ref: > projects.id]
user_id bigint [not null, ref: > users.id]
access varchar(10) [not null, default: 'write']
indexes {
(project_id, user_id) [pk]
}
}

Table boards {
id bigint [pk, increment]
project_id bigint [not null, ref: > projects.id]
name varchar(100) [not null]
position integer [not null, default: 0]
}

Table board_columns {
id bigint [pk, increment]
board_id bigint [not null, ref: > boards.id]
name varchar(100) [not null]
position integer [not null]
wip_limit integer
}

Table milestones {
id bigint [pk, increment]
project_id bigint [not null, ref: > projects.id]
title varchar(200) [not null]
due_on date
closed_at timestamptz
}

Table issues {
id bigint [pk, increment]
project_id bigint [not null, ref: > projects.id]
column_id bigint [ref: > board_columns.id]
milestone_id bigint [ref: > milestones.id]
reporter_id bigint [not null, ref: > users.id]
assignee_id bigint [ref: > users.id]
parent_id bigint [ref: > issues.id]
number integer [not null]
title varchar(300) [not null]
description text
priority smallint [not null, default: 3]
estimate_points smallint
closed_at timestamptz
created_at timestamptz [not null, default: `now()`]
updated_at timestamptz

Note: 'Core work item'
}

Table issue_comments {
id bigint [pk, increment]
issue_id bigint [not null, ref: > issues.id]
author_id bigint [not null, ref: > users.id]
body text [not null]
created_at timestamptz [not null, default: `now()`]
updated_at timestamptz
}

Table labels {
id bigint [pk, increment]
project_id bigint [not null, ref: > projects.id]
name varchar(50) [not null]
color char(7) [not null, default: '#cccccc']
}

Table issue_labels {
issue_id bigint [not null, ref: > issues.id]
label_id bigint [not null, ref: > labels.id]
indexes {
(issue_id, label_id) [pk]
}
}

Table issue_links {
id bigint [pk, increment]
source_issue_id bigint [not null, ref: > issues.id]
target_issue_id bigint [not null, ref: > issues.id]
kind varchar(20) [not null]
}

Table issue_watchers {
issue_id bigint [not null, ref: > issues.id]
user_id bigint [not null, ref: > users.id]
indexes {
(issue_id, user_id) [pk]
}
}

Table time_entries {
id bigint [pk, increment]
issue_id bigint [not null, ref: > issues.id]
user_id bigint [not null, ref: > users.id]
minutes integer [not null]
spent_on date [not null]
note text
}

Table sprints {
id bigint [pk, increment]
board_id bigint [not null, ref: > boards.id]
name varchar(100) [not null]
starts_on date [not null]
ends_on date [not null]
}

Table sprint_issues {
sprint_id bigint [not null, ref: > sprints.id]
issue_id bigint [not null, ref: > issues.id]
indexes {
(sprint_id, issue_id) [pk]
}
}

Table custom_fields {
id bigint [pk, increment]
project_id bigint [not null, ref: > projects.id]
name varchar(100) [not null]
field_type varchar(20) [not null]
}

Table custom_field_values {
id bigint [pk, increment]
custom_field_id bigint [not null, ref: > custom_fields.id]
issue_id bigint [not null, ref: > issues.id]
value_text text
value_number numeric
}

Table documents {
id bigint [pk, increment]
workspace_id bigint [not null, ref: > workspaces.id]
author_id bigint [not null, ref: > users.id]
parent_id bigint [ref: > documents.id]
title varchar(300) [not null]
body jsonb
published_at timestamptz
created_at timestamptz [not null, default: `now()`]
updated_at timestamptz
}

Table document_versions {
id bigint [pk, increment]
document_id bigint [not null, ref: > documents.id]
author_id bigint [not null, ref: > users.id]
version integer [not null]
body jsonb [not null]
created_at timestamptz [not null, default: `now()`]
}

Table attachments {
id bigint [pk, increment]
workspace_id bigint [not null, ref: > workspaces.id]
uploaded_by bigint [not null, ref: > users.id]
issue_id bigint [ref: > issues.id]
document_id bigint [ref: > documents.id]
file_name varchar(255) [not null]
content_type varchar(100)
size_bytes bigint [not null]
storage_key varchar(500) [not null, unique]
created_at timestamptz [not null, default: `now()`]
}

Table reactions {
id bigint [pk, increment]
user_id bigint [not null, ref: > users.id]
comment_id bigint [not null, ref: > issue_comments.id]
emoji varchar(32) [not null]
}

Table mentions {
id bigint [pk, increment]
comment_id bigint [not null, ref: > issue_comments.id]
mentioned_user_id bigint [not null, ref: > users.id]
notified boolean [not null, default: false]
}

Table notifications {
id bigint [pk, increment]
user_id bigint [not null, ref: > users.id]
kind varchar(40) [not null]
payload jsonb [not null]
read_at timestamptz
created_at timestamptz [not null, default: `now()`]
}

Table notification_preferences {
id bigint [pk, increment]
user_id bigint [not null, ref: > users.id]
channel varchar(20) [not null]
kind varchar(40) [not null]
enabled boolean [not null, default: true]
}

Table integrations {
id bigint [pk, increment]
workspace_id bigint [not null, ref: > workspaces.id]
installed_by bigint [not null, ref: > users.id]
provider varchar(40) [not null]
config jsonb
status varchar(20) [not null, default: 'active']
created_at timestamptz [not null, default: `now()`]
updated_at timestamptz
}

Table webhooks {
id bigint [pk, increment]
workspace_id bigint [not null, ref: > workspaces.id]
url varchar(1000) [not null]
secret char(32) [not null]
events text[]
is_active boolean [not null, default: true]
created_at timestamptz [not null, default: `now()`]
updated_at timestamptz
}

Table webhook_deliveries {
id bigint [pk, increment]
webhook_id bigint [not null, ref: > webhooks.id]
event varchar(64) [not null]
status_code smallint
attempt smallint [not null, default: 1]
delivered_at timestamptz
}

Table audit_events {
id bigint [pk, increment]
organization_id bigint [not null, ref: > organizations.id]
actor_id bigint [ref: > users.id]
action varchar(100) [not null]
target_type varchar(50)
target_id bigint
ip inet
occurred_at timestamptz [not null, default: `now()`]
}

Table feature_flags {
id bigint [pk, increment]
key varchar(100) [not null, unique]
description text
rollout_percent smallint [not null, default: 0]
}

Table feature_flag_overrides {
id bigint [pk, increment]
feature_flag_id bigint [not null, ref: > feature_flags.id]
organization_id bigint [not null, ref: > organizations.id]
enabled boolean [not null]
}

Table saved_views {
id bigint [pk, increment]
user_id bigint [not null, ref: > users.id]
project_id bigint [not null, ref: > projects.id]
name varchar(100) [not null]
filters jsonb [not null]
}

Table search_index_jobs {
id bigint [pk, increment]
workspace_id bigint [not null, ref: > workspaces.id]
status varchar(20) [not null]
started_at timestamptz
finished_at timestamptz
}

Table exports {
id bigint [pk, increment]
workspace_id bigint [not null, ref: > workspaces.id]
requested_by bigint [not null, ref: > users.id]
format varchar(10) [not null]
status varchar(20) [not null]
storage_key varchar(500)
created_at timestamptz [not null, default: `now()`]
}

Table imports {
id bigint [pk, increment]
workspace_id bigint [not null, ref: > workspaces.id]
requested_by bigint [not null, ref: > users.id]
source varchar(40) [not null]
status varchar(20) [not null]
error text
created_at timestamptz [not null, default: `now()`]
}

Table daily_active_users {
day date
organization_id bigint [ref: > organizations.id]
users integer [not null]
indexes {
(day, organization_id) [pk]
}
}

Table issue_metrics {
issue_id bigint [pk, ref: > issues.id]
cycle_time_hours numeric
reopened_count smallint [not null, default: 0]
}

Ref: organizations.plan_id > plans.id [delete: set null]

TableGroup tenancy [color: #2c3e50] {
organizations
workspaces
memberships
roles
permissions
role_permissions
invitations
teams
team_members
}

TableGroup identity [color: #8e44ad] {
users
user_identities
user_sessions
api_tokens
}

TableGroup billing [color: #27ae60] {
plans
plan_features
subscriptions
subscription_items
invoices
invoice_lines
payment_methods
payments
refunds
coupons
coupon_redemptions
usage_records
tax_rates
}

TableGroup work [color: #2980b9] {
projects
project_members
boards
board_columns
milestones
issues
issue_comments
labels
issue_labels
issue_links
issue_watchers
time_entries
sprints
sprint_issues
custom_fields
custom_field_values
}

TableGroup content [color: #d35400] {
documents
document_versions
attachments
reactions
mentions
}

TableGroup platform [color: #7f8c8d] {
notifications
notification_preferences
integrations
webhooks
webhook_deliveries
audit_events
feature_flags
feature_flag_overrides
saved_views
search_index_jobs
exports
imports
}

TableGroup analytics [color: #c0392b] {
daily_active_users
issue_metrics
}

DiagramView billing_only {
TableGroups { billing }
}

DiagramView work_and_identity {
TableGroups {
work
identity
}
}