News site paywall database schema

How a digital newspaper models a metered paywall: articles with revisions, the per-reader meter, plans and subscriptions, gift links, newsletters and moderated comments.

News Paywall ER diagram

News site paywall database schema n1 n1 11 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 sections idBIGINT parent_idBIGINT nameVARCHAR slugVARCHAR default_accessVARCHAR positionINTEGER authors idBIGINT slugVARCHAR display_nameVARCHAR roleVARCHAR bioTEXT emailVARCHAR activeBOOLEAN articles idBIGINT section_idBIGINT live_revision_idBIGINT slugVARCHAR kickerVARCHAR access_levelVARCHAR statusVARCHAR published_atTIMESTAMPTZ updated_atTIMESTAMPTZ word_countINTEGER article_revisions idBIGINT article_idBIGINT revision_numberINTEGER headlineVARCHAR standfirstVARCHAR bodyTEXT free_excerpt_charsINTEGER change_noteVARCHAR created_byBIGINT created_atTIMESTAMPTZ article_authors article_idBIGINT author_idBIGINT positionINTEGER contributionVARCHAR readers idBIGINT emailVARCHAR anonymous_keyVARCHAR display_nameVARCHAR registered_atTIMESTAMPTZ comment_statusVARCHAR created_atTIMESTAMPTZ plans idBIGINT codeVARCHAR nameVARCHAR price_centsINTEGER currency_codeCHAR intervalVARCHAR meter_limitINTEGER gift_allowanceINTEGER includes_archiveBOOLEAN activeBOOLEAN subscriptions idBIGINT reader_idBIGINT plan_idBIGINT statusVARCHAR provider_referenceVARCHAR current_period_st…TIMESTAMPTZ current_period_endTIMESTAMPTZ cancel_at_period_…BOOLEAN started_atTIMESTAMPTZ meter_periods idBIGINT reader_idBIGINT period_startDATE period_endDATE articles_viewedINTEGER allowanceINTEGER last_viewed_atTIMESTAMPTZ meter_views meter_period_idBIGINT article_idBIGINT first_viewed_atTIMESTAMPTZ unlocked_byVARCHAR gift_links idBIGINT article_idBIGINT minted_byBIGINT tokenVARCHAR max_redemptionsINTEGER redemptions_usedINTEGER expires_atTIMESTAMPTZ revoked_atTIMESTAMPTZ created_atTIMESTAMPTZ newsletters idBIGINT codeVARCHAR nameVARCHAR descriptionVARCHAR cadenceVARCHAR subscriber_onlyBOOLEAN activeBOOLEAN newsletter_signups newsletter_idBIGINT reader_idBIGINT statusVARCHAR sourceVARCHAR subscribed_atTIMESTAMPTZ unsubscribed_atTIMESTAMPTZ newsletter_sends idBIGINT newsletter_idBIGINT subjectVARCHAR lead_article_idBIGINT scheduled_forTIMESTAMPTZ sent_atTIMESTAMPTZ recipient_countINTEGER open_countINTEGER click_countINTEGER comments idBIGINT article_idBIGINT reader_idBIGINT parent_idBIGINT bodyTEXT statusVARCHAR moderated_byBIGINT moderation_reasonVARCHAR flag_countINTEGER created_atTIMESTAMPTZ

Related database schemas