Creator memberships database schema
Creators offering paid tiers, supporters' pledges and members-only posts.
5 tables, 5 relationships
Opens as a new diagram you can change. Free.
Tables
creators
- iduuid not null
- nametext not null
- slugtext not null
- created_attimestamptz not null
tiers
- iduuid not null
- creator_id> creatorsuuid not null
- nametext not null
- monthly_pricenumeric(8,2) not null
- perkstext
- created_attimestamptz not null
supporters
- iduuid not null
- emailtext not null
- nametext not null
- created_attimestamptz not null
pledges
- iduuid not null
- supporter_id> supportersuuid not null
- tier_id> tiersuuid not null
- activeboolean not null
- started_attimestamptz not null
- created_attimestamptz not null
creator_posts
- iduuid not null
- creator_id> creatorsuuid not null
- min_tier_id> tiersuuid
- titletext not null
- bodytext not null
- created_attimestamptz not null
As PostgreSQL
The same diagram exports to MySQL, MariaDB, SQLite, SQL Server and Oracle, and to Prisma, Drizzle, SQLAlchemy and Convex models.
CREATE TABLE "creator_posts" (
"id" UUID DEFAULT gen_random_uuid() NOT NULL,
"creator_id" UUID NOT NULL,
"min_tier_id" UUID,
"title" TEXT NOT NULL,
"body" TEXT NOT NULL,
"created_at" TIMESTAMPTZ DEFAULT now() NOT NULL,
PRIMARY KEY ("id")
);
CREATE TABLE "creators" (
"id" UUID DEFAULT gen_random_uuid() NOT NULL,
"name" TEXT NOT NULL,
"slug" TEXT NOT NULL UNIQUE,
"created_at" TIMESTAMPTZ DEFAULT now() NOT NULL,
PRIMARY KEY ("id")
);
CREATE TABLE "pledges" (
"id" UUID DEFAULT gen_random_uuid() NOT NULL,
"supporter_id" UUID NOT NULL,
"tier_id" UUID NOT NULL,
"active" BOOLEAN DEFAULT true NOT NULL,
"started_at" TIMESTAMPTZ DEFAULT now() NOT NULL,
"created_at" TIMESTAMPTZ DEFAULT now() NOT NULL,
PRIMARY KEY ("id")
);
CREATE TABLE "supporters" (
"id" UUID DEFAULT gen_random_uuid() NOT NULL,
"email" TEXT NOT NULL UNIQUE,
"name" TEXT NOT NULL,
"created_at" TIMESTAMPTZ DEFAULT now() NOT NULL,
PRIMARY KEY ("id")
);
CREATE TABLE "tiers" (
"id" UUID DEFAULT gen_random_uuid() NOT NULL,
"creator_id" UUID NOT NULL,
"name" TEXT NOT NULL,
"monthly_price" NUMERIC(8,2) NOT NULL,
"perks" TEXT,
"created_at" TIMESTAMPTZ DEFAULT now() NOT NULL,
PRIMARY KEY ("id")
);
ALTER TABLE "tiers" ADD CONSTRAINT "fk_tiers_creator_id" FOREIGN KEY ("creator_id") REFERENCES "creators" ("id") ON DELETE CASCADE ON UPDATE NO ACTION;
ALTER TABLE "pledges" ADD CONSTRAINT "fk_pledges_supporter_id" FOREIGN KEY ("supporter_id") REFERENCES "supporters" ("id") ON DELETE CASCADE ON UPDATE NO ACTION;
ALTER TABLE "pledges" ADD CONSTRAINT "fk_pledges_tier_id" FOREIGN KEY ("tier_id") REFERENCES "tiers" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
ALTER TABLE "creator_posts" ADD CONSTRAINT "fk_creator_posts_creator_id" FOREIGN KEY ("creator_id") REFERENCES "creators" ("id") ON DELETE CASCADE ON UPDATE NO ACTION;
ALTER TABLE "creator_posts" ADD CONSTRAINT "fk_creator_posts_min_tier_id" FOREIGN KEY ("min_tier_id") REFERENCES "tiers" ("id") ON DELETE SET NULL ON UPDATE NO ACTION;More Social & community templates
- Social networkProfiles, follows, posts with media, comments and likes.
- Discussion forumCategories, threads and posts with reactions and moderation reports.
- Chat / messagingDirect and group conversations, messages, attachments and read receipts.
- Dating appProfiles with photos, swipes, mutual matches, messages and blocks.
- Meetup groupsInterest groups with members, events at venues and RSVPs.
- Q&A siteQuestions, answers with votes, accepted answers and tags.
- Reviews & ratingsBusinesses reviewed by users, with photos, helpful votes and owner replies.
- GamificationPoints ledger, levels, badges and streaks for an engaged community.
- Mentorship programmeProgrammes matching mentors with mentees, sessions and feedback.
- Chat app (Firestore)Users, rooms with their members, and messages as a subcollection of each room.
- Activity feed (Cassandra)Each user's feed by time bucket, follower lists both ways, and like counters.
Start with one diagram, free
One diagram with two branches, no card needed. Upgrade when your team needs more.