Templates/Work & productivity

Applicant tracking database schema

Job openings, candidates, applications through stages, interviews and scorecards.

7 tables, 7 relationships

Opens as a new diagram you can change. Free.

Tables

jobs

  • iduuid not null
  • titletext not null
  • departmenttext not null
  • locationtext
  • openboolean not null
  • created_attimestamptz not null

candidates

  • iduuid not null
  • nametext not null
  • emailtext not null
  • resume_urltext
  • created_attimestamptz not null

hiring_stages

  • iduuid not null
  • job_id> jobsuuid not null
  • nametext not null
  • positioninteger not null
  • created_attimestamptz not null

applications

  • iduuid not null
  • job_id> jobsuuid not null
  • candidate_id> candidatesuuid not null
  • stage_id> hiring_stagesuuid not null
  • sourcetext
  • rejected_attimestamptz
  • created_attimestamptz not null

interviewers

  • iduuid not null
  • nametext not null
  • emailtext not null
  • created_attimestamptz not null

interviews

  • iduuid not null
  • application_id> applicationsuuid not null
  • interviewer_id> interviewersuuid not null
  • scheduled_attimestamptz not null
  • created_attimestamptz not null

scorecards

  • iduuid not null
  • interview_id> interviewsuuid not null
  • recommendationtext not null
  • notestext
  • 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 "applications" (
  "id" UUID DEFAULT gen_random_uuid() NOT NULL,
  "job_id" UUID NOT NULL,
  "candidate_id" UUID NOT NULL,
  "stage_id" UUID NOT NULL,
  "source" TEXT,
  "rejected_at" TIMESTAMPTZ,
  "created_at" TIMESTAMPTZ DEFAULT now() NOT NULL,
  PRIMARY KEY ("id")
);

CREATE TABLE "candidates" (
  "id" UUID DEFAULT gen_random_uuid() NOT NULL,
  "name" TEXT NOT NULL,
  "email" TEXT NOT NULL UNIQUE,
  "resume_url" TEXT,
  "created_at" TIMESTAMPTZ DEFAULT now() NOT NULL,
  PRIMARY KEY ("id")
);

CREATE TABLE "hiring_stages" (
  "id" UUID DEFAULT gen_random_uuid() NOT NULL,
  "job_id" UUID NOT NULL,
  "name" TEXT NOT NULL,
  "position" INTEGER NOT NULL,
  "created_at" TIMESTAMPTZ DEFAULT now() NOT NULL,
  PRIMARY KEY ("id")
);

CREATE TABLE "interviewers" (
  "id" UUID DEFAULT gen_random_uuid() NOT NULL,
  "name" TEXT NOT NULL,
  "email" TEXT NOT NULL UNIQUE,
  "created_at" TIMESTAMPTZ DEFAULT now() NOT NULL,
  PRIMARY KEY ("id")
);

CREATE TABLE "interviews" (
  "id" UUID DEFAULT gen_random_uuid() NOT NULL,
  "application_id" UUID NOT NULL,
  "interviewer_id" UUID NOT NULL,
  "scheduled_at" TIMESTAMPTZ NOT NULL,
  "created_at" TIMESTAMPTZ DEFAULT now() NOT NULL,
  PRIMARY KEY ("id")
);

CREATE TABLE "jobs" (
  "id" UUID DEFAULT gen_random_uuid() NOT NULL,
  "title" TEXT NOT NULL,
  "department" TEXT NOT NULL,
  "location" TEXT,
  "open" BOOLEAN DEFAULT true NOT NULL,
  "created_at" TIMESTAMPTZ DEFAULT now() NOT NULL,
  PRIMARY KEY ("id")
);

CREATE TABLE "scorecards" (
  "id" UUID DEFAULT gen_random_uuid() NOT NULL,
  "interview_id" UUID NOT NULL UNIQUE,
  "recommendation" TEXT NOT NULL,
  "notes" TEXT,
  "created_at" TIMESTAMPTZ DEFAULT now() NOT NULL,
  PRIMARY KEY ("id")
);

ALTER TABLE "hiring_stages" ADD CONSTRAINT "fk_hiring_stages_job_id" FOREIGN KEY ("job_id") REFERENCES "jobs" ("id") ON DELETE CASCADE ON UPDATE NO ACTION;

ALTER TABLE "applications" ADD CONSTRAINT "fk_applications_job_id" FOREIGN KEY ("job_id") REFERENCES "jobs" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION;

ALTER TABLE "applications" ADD CONSTRAINT "fk_applications_candidate_id" FOREIGN KEY ("candidate_id") REFERENCES "candidates" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION;

ALTER TABLE "applications" ADD CONSTRAINT "fk_applications_stage_id" FOREIGN KEY ("stage_id") REFERENCES "hiring_stages" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION;

ALTER TABLE "interviews" ADD CONSTRAINT "fk_interviews_application_id" FOREIGN KEY ("application_id") REFERENCES "applications" ("id") ON DELETE CASCADE ON UPDATE NO ACTION;

ALTER TABLE "interviews" ADD CONSTRAINT "fk_interviews_interviewer_id" FOREIGN KEY ("interviewer_id") REFERENCES "interviewers" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION;

ALTER TABLE "scorecards" ADD CONSTRAINT "fk_scorecards_interview_id" FOREIGN KEY ("interview_id") REFERENCES "interviews" ("id") ON DELETE CASCADE ON UPDATE NO ACTION;

More Work & productivity templates

Start with one diagram, free

One diagram with two branches, no card needed. Upgrade when your team needs more.