@adaptware/eagles-db 0.4.38 → 0.4.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/edge.js +8 -6
- package/client/index-browser.js +1 -0
- package/client/index.d.ts +598 -2
- package/client/index.js +8 -6
- package/client/package.json +1 -1
- package/client/schema.prisma +30 -27
- package/client/wasm.js +8 -6
- package/package.json +1 -1
- package/prisma/schema/document.prisma +1 -0
- package/prisma/schema/jobDescription.prisma +2 -0
- package/prisma/schema/migrations/20260522120000_ongoing_evaluation_record_kind/migration.sql +25 -0
- package/prisma/schema/migrations/20260523120000_replace_record_kind_with_is_committed/migration.sql +24 -0
- package/prisma/schema/migrations/20260528120000_drop_job_description_recommendation_config/migration.sql +2 -0
- package/prisma/schema/migrations/20260710120000_add_resume_rendered_export_fields/migration.sql +9 -0
- package/prisma/schema/migrations/20260714120000_add_job_description_display_html_document/migration.sql +8 -0
- package/client/libquery_engine-darwin.dylib.node +0 -0
- package/prisma/.DS_Store +0 -0
- package/prisma/migrations/20260519120000_migrate_shortlisted_to_selected/migration.sql +0 -2
- package/prisma/schema/.DS_Store +0 -0
- package/prisma/schema/migrations/20260519120000_add_analytics_schema/migration.sql +0 -84
- package/prisma/schema/migrations/20260625120000_add_interviewer_analytics/migration.sql +0 -26
- package/prisma/schema/migrations/20260629120000_add_user_lifecycle_activity_events/migration.sql +0 -13
- package/prisma/schema/migrations/20260629140000_drop_organisation_org_code/migration.sql +0 -2
- package/prisma/schema/migrations/20260629160000_employee_codes_dual_interviewer_analytics/migration.sql +0 -87
- package/prisma/schema/migrations/20260630120000_add_application_sources/migration.sql +0 -38
- package/prisma/schema/migrations/20260701120000_add_source_effectiveness_analytics/migration.sql +0 -40
- package/prisma/schema/migrations/20260702120000_add_analytics_daily_tables/migration.sql +0 -232
package/package.json
CHANGED
|
@@ -27,6 +27,7 @@ model Document {
|
|
|
27
27
|
resume_rendered_export Resume? @relation("RenderedResumeExport")
|
|
28
28
|
job_description_source JobDescription? @relation("SourceDocument")
|
|
29
29
|
job_description_rendered JobDescription? @relation("RenderedJdDocument")
|
|
30
|
+
job_description_display_html JobDescription? @relation("DisplayHtmlDocument")
|
|
30
31
|
interview_recording Interview?
|
|
31
32
|
job_application_responses JobApplicationResponse[]
|
|
32
33
|
assignment_solution Assignment? @relation("AssignmentSolutionDocument")
|
|
@@ -20,6 +20,8 @@ model JobDescription {
|
|
|
20
20
|
source_document_id String? @unique
|
|
21
21
|
rendered_jd_document_id String? @unique
|
|
22
22
|
rendered_jd_document Document? @relation("RenderedJdDocument", fields: [rendered_jd_document_id], references: [id], onDelete: SetNull)
|
|
23
|
+
display_html_document_id String? @unique
|
|
24
|
+
display_html_document Document? @relation("DisplayHtmlDocument", fields: [display_html_document_id], references: [id], onDelete: SetNull)
|
|
23
25
|
is_plan_published Boolean @default(false)
|
|
24
26
|
is_posted Boolean @default(false)
|
|
25
27
|
summary Json?
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
-- Safe to re-run: adds record_kind without breaking existing ongoing evaluations.
|
|
2
|
+
|
|
3
|
+
DO $$ BEGIN
|
|
4
|
+
CREATE TYPE "OngoingEvaluationRecordKind" AS ENUM (
|
|
5
|
+
'AI_RECOMMENDED',
|
|
6
|
+
'PLAN_SELECTED',
|
|
7
|
+
'COMMITTED'
|
|
8
|
+
);
|
|
9
|
+
EXCEPTION
|
|
10
|
+
WHEN duplicate_object THEN NULL;
|
|
11
|
+
END $$;
|
|
12
|
+
|
|
13
|
+
ALTER TABLE "OngoingEvaluation"
|
|
14
|
+
ADD COLUMN IF NOT EXISTS "record_kind" "OngoingEvaluationRecordKind";
|
|
15
|
+
|
|
16
|
+
ALTER TABLE "OngoingEvaluation"
|
|
17
|
+
ALTER COLUMN "evaluation_plan_id" DROP NOT NULL;
|
|
18
|
+
|
|
19
|
+
-- All existing rows are real pipeline rounds — not pre-Proceed drafts.
|
|
20
|
+
UPDATE "OngoingEvaluation"
|
|
21
|
+
SET "record_kind" = 'COMMITTED'
|
|
22
|
+
WHERE "record_kind" IS NULL;
|
|
23
|
+
|
|
24
|
+
CREATE INDEX IF NOT EXISTS "OngoingEvaluation_application_id_record_kind_idx"
|
|
25
|
+
ON "OngoingEvaluation"("application_id", "record_kind");
|
package/prisma/schema/migrations/20260523120000_replace_record_kind_with_is_committed/migration.sql
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
-- Replace record_kind enum with is_committed (null = legacy, false = draft, true = committed).
|
|
2
|
+
|
|
3
|
+
ALTER TABLE "OngoingEvaluation"
|
|
4
|
+
ADD COLUMN IF NOT EXISTS "is_committed" BOOLEAN;
|
|
5
|
+
|
|
6
|
+
UPDATE "OngoingEvaluation"
|
|
7
|
+
SET "is_committed" = false
|
|
8
|
+
WHERE "record_kind" IN ('AI_RECOMMENDED', 'PLAN_SELECTED');
|
|
9
|
+
|
|
10
|
+
UPDATE "OngoingEvaluation"
|
|
11
|
+
SET "is_committed" = true
|
|
12
|
+
WHERE "record_kind" = 'COMMITTED';
|
|
13
|
+
|
|
14
|
+
-- Legacy rows without record_kind stay null (treated as committed in app queries).
|
|
15
|
+
|
|
16
|
+
DROP INDEX IF EXISTS "OngoingEvaluation_application_id_record_kind_idx";
|
|
17
|
+
|
|
18
|
+
ALTER TABLE "OngoingEvaluation"
|
|
19
|
+
DROP COLUMN IF EXISTS "record_kind";
|
|
20
|
+
|
|
21
|
+
DROP TYPE IF EXISTS "OngoingEvaluationRecordKind";
|
|
22
|
+
|
|
23
|
+
CREATE INDEX IF NOT EXISTS "OngoingEvaluation_application_id_is_committed_idx"
|
|
24
|
+
ON "OngoingEvaluation"("application_id", "is_committed");
|
package/prisma/schema/migrations/20260710120000_add_resume_rendered_export_fields/migration.sql
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
-- AlterTable
|
|
2
|
+
ALTER TABLE "Resume" ADD COLUMN "rendered_export_document_id" TEXT,
|
|
3
|
+
ADD COLUMN "resume_template_id" TEXT;
|
|
4
|
+
|
|
5
|
+
-- CreateIndex
|
|
6
|
+
CREATE UNIQUE INDEX "Resume_rendered_export_document_id_key" ON "Resume"("rendered_export_document_id");
|
|
7
|
+
|
|
8
|
+
-- AddForeignKey
|
|
9
|
+
ALTER TABLE "Resume" ADD CONSTRAINT "Resume_rendered_export_document_id_fkey" FOREIGN KEY ("rendered_export_document_id") REFERENCES "Document"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
-- AlterTable
|
|
2
|
+
ALTER TABLE "JobDescription" ADD COLUMN "display_html_document_id" TEXT;
|
|
3
|
+
|
|
4
|
+
-- CreateIndex
|
|
5
|
+
CREATE UNIQUE INDEX "JobDescription_display_html_document_id_key" ON "JobDescription"("display_html_document_id");
|
|
6
|
+
|
|
7
|
+
-- AddForeignKey
|
|
8
|
+
ALTER TABLE "JobDescription" ADD CONSTRAINT "JobDescription_display_html_document_id_fkey" FOREIGN KEY ("display_html_document_id") REFERENCES "Document"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
Binary file
|
package/prisma/.DS_Store
DELETED
|
Binary file
|
package/prisma/schema/.DS_Store
DELETED
|
Binary file
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
-- CreateSchema
|
|
2
|
-
CREATE SCHEMA IF NOT EXISTS "analytics";
|
|
3
|
-
|
|
4
|
-
-- CreateEnum
|
|
5
|
-
CREATE TYPE "analytics"."RoundResult" AS ENUM ('PASSED', 'FAILED');
|
|
6
|
-
|
|
7
|
-
-- CreateTable
|
|
8
|
-
CREATE TABLE "analytics"."round_analytics" (
|
|
9
|
-
"id" TEXT NOT NULL,
|
|
10
|
-
"organisation_id" TEXT NOT NULL,
|
|
11
|
-
"application_id" TEXT NOT NULL,
|
|
12
|
-
"candidate_id" TEXT NOT NULL,
|
|
13
|
-
"job_description_id" TEXT NOT NULL,
|
|
14
|
-
"evaluation_plan_id" TEXT NOT NULL,
|
|
15
|
-
"round_id" TEXT NOT NULL,
|
|
16
|
-
"round_name" TEXT,
|
|
17
|
-
"evaluation_category" "EvaluationCategory",
|
|
18
|
-
"round_type" "RoundType",
|
|
19
|
-
"assigned_at" TIMESTAMP(3),
|
|
20
|
-
"interview_created_at" TIMESTAMP(3),
|
|
21
|
-
"interview_scheduled_at" TIMESTAMP(3),
|
|
22
|
-
"interview_started_at" TIMESTAMP(3),
|
|
23
|
-
"interview_completed_at" TIMESTAMP(3),
|
|
24
|
-
"interview_evaluated_at" TIMESTAMP(3),
|
|
25
|
-
"round_completed_at" TIMESTAMP(3),
|
|
26
|
-
"round_result" "analytics"."RoundResult",
|
|
27
|
-
"round_result_at" TIMESTAMP(3),
|
|
28
|
-
"scheduling_duration_minutes" INTEGER,
|
|
29
|
-
"interview_duration_minutes" INTEGER,
|
|
30
|
-
"feedback_duration_minutes" INTEGER,
|
|
31
|
-
"decision_duration_minutes" INTEGER,
|
|
32
|
-
"total_round_duration_minutes" INTEGER,
|
|
33
|
-
"is_custom" BOOLEAN NOT NULL DEFAULT false,
|
|
34
|
-
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
35
|
-
"updated_at" TIMESTAMP(3) NOT NULL,
|
|
36
|
-
|
|
37
|
-
CONSTRAINT "round_analytics_pkey" PRIMARY KEY ("id")
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
-- CreateTable
|
|
41
|
-
CREATE TABLE "analytics"."job_round_analytics" (
|
|
42
|
-
"id" TEXT NOT NULL,
|
|
43
|
-
"organisation_id" TEXT NOT NULL,
|
|
44
|
-
"job_description_id" TEXT NOT NULL,
|
|
45
|
-
"evaluation_plan_id" TEXT NOT NULL,
|
|
46
|
-
"round_name" TEXT NOT NULL,
|
|
47
|
-
"evaluation_category" "EvaluationCategory",
|
|
48
|
-
"is_custom" BOOLEAN NOT NULL DEFAULT false,
|
|
49
|
-
"assigned_count" INTEGER NOT NULL DEFAULT 0,
|
|
50
|
-
"completed_count" INTEGER NOT NULL DEFAULT 0,
|
|
51
|
-
"passed_count" INTEGER NOT NULL DEFAULT 0,
|
|
52
|
-
"failed_count" INTEGER NOT NULL DEFAULT 0,
|
|
53
|
-
"withdrawn_count" INTEGER NOT NULL DEFAULT 0,
|
|
54
|
-
"no_show_count" INTEGER NOT NULL DEFAULT 0,
|
|
55
|
-
"total_completion_minutes" BIGINT NOT NULL DEFAULT 0,
|
|
56
|
-
"avg_completion_minutes" DOUBLE PRECISION,
|
|
57
|
-
"updated_at" TIMESTAMP(3) NOT NULL,
|
|
58
|
-
|
|
59
|
-
CONSTRAINT "job_round_analytics_pkey" PRIMARY KEY ("id")
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
-- CreateIndex
|
|
63
|
-
CREATE UNIQUE INDEX "round_analytics_round_id_key" ON "analytics"."round_analytics"("round_id");
|
|
64
|
-
|
|
65
|
-
-- CreateIndex
|
|
66
|
-
CREATE INDEX "round_analytics_organisation_id_idx" ON "analytics"."round_analytics"("organisation_id");
|
|
67
|
-
|
|
68
|
-
-- CreateIndex
|
|
69
|
-
CREATE INDEX "round_analytics_job_description_id_idx" ON "analytics"."round_analytics"("job_description_id");
|
|
70
|
-
|
|
71
|
-
-- CreateIndex
|
|
72
|
-
CREATE INDEX "round_analytics_application_id_idx" ON "analytics"."round_analytics"("application_id");
|
|
73
|
-
|
|
74
|
-
-- CreateIndex
|
|
75
|
-
CREATE INDEX "round_analytics_candidate_id_idx" ON "analytics"."round_analytics"("candidate_id");
|
|
76
|
-
|
|
77
|
-
-- CreateIndex
|
|
78
|
-
CREATE INDEX "round_analytics_evaluation_category_idx" ON "analytics"."round_analytics"("evaluation_category");
|
|
79
|
-
|
|
80
|
-
-- CreateIndex
|
|
81
|
-
CREATE INDEX "round_analytics_round_result_idx" ON "analytics"."round_analytics"("round_result");
|
|
82
|
-
|
|
83
|
-
-- CreateIndex
|
|
84
|
-
CREATE UNIQUE INDEX "job_round_analytics_job_description_id_evaluation_plan_id_key" ON "analytics"."job_round_analytics"("job_description_id", "evaluation_plan_id");
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
-- CreateTable
|
|
2
|
-
CREATE TABLE "analytics"."interviewer_analytics" (
|
|
3
|
-
"id" TEXT NOT NULL,
|
|
4
|
-
"organisation_id" TEXT NOT NULL,
|
|
5
|
-
"user_id" TEXT NOT NULL,
|
|
6
|
-
"name" TEXT,
|
|
7
|
-
"employee_id" TEXT,
|
|
8
|
-
"interview_count" INTEGER NOT NULL DEFAULT 0,
|
|
9
|
-
"accepted_count" INTEGER NOT NULL DEFAULT 0,
|
|
10
|
-
"rejected_count" INTEGER NOT NULL DEFAULT 0,
|
|
11
|
-
"unsure_count" INTEGER NOT NULL DEFAULT 0,
|
|
12
|
-
"ai_disagreement_count" INTEGER NOT NULL DEFAULT 0,
|
|
13
|
-
"ai_disagreement_percent" DOUBLE PRECISION,
|
|
14
|
-
"avg_difficulty" DOUBLE PRECISION,
|
|
15
|
-
"avg_supportiveness" DOUBLE PRECISION,
|
|
16
|
-
"avg_topics_coverage_percent" DOUBLE PRECISION,
|
|
17
|
-
"updated_at" TIMESTAMP(3) NOT NULL,
|
|
18
|
-
|
|
19
|
-
CONSTRAINT "interviewer_analytics_pkey" PRIMARY KEY ("id")
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
-- CreateIndex
|
|
23
|
-
CREATE UNIQUE INDEX "interviewer_analytics_organisation_id_user_id_key" ON "analytics"."interviewer_analytics"("organisation_id", "user_id");
|
|
24
|
-
|
|
25
|
-
-- CreateIndex
|
|
26
|
-
CREATE INDEX "interviewer_analytics_organisation_id_idx" ON "analytics"."interviewer_analytics"("organisation_id");
|
package/prisma/schema/migrations/20260629120000_add_user_lifecycle_activity_events/migration.sql
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
-- AlterEnum
|
|
2
|
-
ALTER TYPE "public"."ActivityEventType" ADD VALUE 'USER_INVITED';
|
|
3
|
-
ALTER TYPE "public"."ActivityEventType" ADD VALUE 'USER_INVITATION_RESENT';
|
|
4
|
-
ALTER TYPE "public"."ActivityEventType" ADD VALUE 'USER_CREATED';
|
|
5
|
-
ALTER TYPE "public"."ActivityEventType" ADD VALUE 'USER_INVITATION_ACCEPTED';
|
|
6
|
-
ALTER TYPE "public"."ActivityEventType" ADD VALUE 'USER_INVITATION_EXPIRED';
|
|
7
|
-
ALTER TYPE "public"."ActivityEventType" ADD VALUE 'USER_DEACTIVATED';
|
|
8
|
-
ALTER TYPE "public"."ActivityEventType" ADD VALUE 'USER_REACTIVATED';
|
|
9
|
-
ALTER TYPE "public"."ActivityEventType" ADD VALUE 'USER_ROLE_CHANGED';
|
|
10
|
-
ALTER TYPE "public"."ActivityEventType" ADD VALUE 'USER_PROFILE_COMPLETED';
|
|
11
|
-
ALTER TYPE "public"."ActivityEventType" ADD VALUE 'CANDIDATE_REGISTERED';
|
|
12
|
-
ALTER TYPE "public"."ActivityEventType" ADD VALUE 'CANDIDATE_CREATED';
|
|
13
|
-
ALTER TYPE "public"."ActivityEventType" ADD VALUE 'CANDIDATE_PROFILE_COMPLETED';
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "employee_number" INTEGER;
|
|
2
|
-
ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "employee_code" TEXT;
|
|
3
|
-
|
|
4
|
-
CREATE UNIQUE INDEX IF NOT EXISTS "User_employee_code_key" ON "User"("employee_code");
|
|
5
|
-
CREATE INDEX IF NOT EXISTS "User_organisation_id_employee_number_idx" ON "User"("organisation_id", "employee_number");
|
|
6
|
-
|
|
7
|
-
DROP TABLE IF EXISTS "analytics"."interviewer_analytics";
|
|
8
|
-
|
|
9
|
-
CREATE TABLE "analytics"."interviewer_organisation_analytics" (
|
|
10
|
-
"id" TEXT NOT NULL,
|
|
11
|
-
"organisation_id" TEXT NOT NULL,
|
|
12
|
-
"user_id" TEXT NOT NULL,
|
|
13
|
-
"name" TEXT,
|
|
14
|
-
"employee_id" TEXT,
|
|
15
|
-
"interview_count" INTEGER NOT NULL DEFAULT 0,
|
|
16
|
-
"accepted_count" INTEGER NOT NULL DEFAULT 0,
|
|
17
|
-
"rejected_count" INTEGER NOT NULL DEFAULT 0,
|
|
18
|
-
"unsure_count" INTEGER NOT NULL DEFAULT 0,
|
|
19
|
-
"ai_disagreement_count" INTEGER NOT NULL DEFAULT 0,
|
|
20
|
-
"ai_disagreement_percent" DOUBLE PRECISION,
|
|
21
|
-
"avg_difficulty" DOUBLE PRECISION,
|
|
22
|
-
"avg_supportiveness" DOUBLE PRECISION,
|
|
23
|
-
"avg_topics_coverage_percent" DOUBLE PRECISION,
|
|
24
|
-
"updated_at" TIMESTAMP(3) NOT NULL,
|
|
25
|
-
|
|
26
|
-
CONSTRAINT "interviewer_organisation_analytics_pkey" PRIMARY KEY ("id")
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
CREATE UNIQUE INDEX "interviewer_organisation_analytics_organisation_id_user_id_key"
|
|
30
|
-
ON "analytics"."interviewer_organisation_analytics"("organisation_id", "user_id");
|
|
31
|
-
CREATE INDEX "interviewer_organisation_analytics_organisation_id_idx"
|
|
32
|
-
ON "analytics"."interviewer_organisation_analytics"("organisation_id");
|
|
33
|
-
CREATE INDEX "interviewer_organisation_analytics_organisation_id_user_id_idx"
|
|
34
|
-
ON "analytics"."interviewer_organisation_analytics"("organisation_id", "user_id");
|
|
35
|
-
|
|
36
|
-
CREATE TABLE "analytics"."interviewer_job_analytics" (
|
|
37
|
-
"id" TEXT NOT NULL,
|
|
38
|
-
"organisation_id" TEXT NOT NULL,
|
|
39
|
-
"user_id" TEXT NOT NULL,
|
|
40
|
-
"job_description_id" TEXT NOT NULL,
|
|
41
|
-
"hiring_manager_id" TEXT,
|
|
42
|
-
"department" TEXT,
|
|
43
|
-
"location" TEXT,
|
|
44
|
-
"role_title" TEXT,
|
|
45
|
-
"job_code" TEXT,
|
|
46
|
-
"opened_at" TIMESTAMP(3),
|
|
47
|
-
"name" TEXT,
|
|
48
|
-
"employee_id" TEXT,
|
|
49
|
-
"interview_count" INTEGER NOT NULL DEFAULT 0,
|
|
50
|
-
"accepted_count" INTEGER NOT NULL DEFAULT 0,
|
|
51
|
-
"rejected_count" INTEGER NOT NULL DEFAULT 0,
|
|
52
|
-
"unsure_count" INTEGER NOT NULL DEFAULT 0,
|
|
53
|
-
"ai_disagreement_count" INTEGER NOT NULL DEFAULT 0,
|
|
54
|
-
"ai_disagreement_percent" DOUBLE PRECISION,
|
|
55
|
-
"avg_difficulty" DOUBLE PRECISION,
|
|
56
|
-
"avg_supportiveness" DOUBLE PRECISION,
|
|
57
|
-
"avg_topics_coverage_percent" DOUBLE PRECISION,
|
|
58
|
-
"updated_at" TIMESTAMP(3) NOT NULL,
|
|
59
|
-
|
|
60
|
-
CONSTRAINT "interviewer_job_analytics_pkey" PRIMARY KEY ("id")
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
CREATE UNIQUE INDEX "interviewer_job_analytics_organisation_id_user_id_job_descri_key"
|
|
64
|
-
ON "analytics"."interviewer_job_analytics"("organisation_id", "user_id", "job_description_id");
|
|
65
|
-
CREATE INDEX "interviewer_job_analytics_organisation_id_job_description_id_idx"
|
|
66
|
-
ON "analytics"."interviewer_job_analytics"("organisation_id", "job_description_id");
|
|
67
|
-
CREATE INDEX "interviewer_job_analytics_organisation_id_hiring_manager_id_idx"
|
|
68
|
-
ON "analytics"."interviewer_job_analytics"("organisation_id", "hiring_manager_id");
|
|
69
|
-
CREATE INDEX "interviewer_job_analytics_organisation_id_department_idx"
|
|
70
|
-
ON "analytics"."interviewer_job_analytics"("organisation_id", "department");
|
|
71
|
-
CREATE INDEX "interviewer_job_analytics_organisation_id_location_idx"
|
|
72
|
-
ON "analytics"."interviewer_job_analytics"("organisation_id", "location");
|
|
73
|
-
CREATE INDEX "interviewer_job_analytics_organisation_id_user_id_idx"
|
|
74
|
-
ON "analytics"."interviewer_job_analytics"("organisation_id", "user_id");
|
|
75
|
-
|
|
76
|
-
CREATE INDEX IF NOT EXISTS "job_round_analytics_organisation_id_idx"
|
|
77
|
-
ON "analytics"."job_round_analytics"("organisation_id");
|
|
78
|
-
CREATE INDEX IF NOT EXISTS "job_round_analytics_organisation_id_hiring_manager_id_idx"
|
|
79
|
-
ON "analytics"."job_round_analytics"("organisation_id", "hiring_manager_id");
|
|
80
|
-
CREATE INDEX IF NOT EXISTS "job_round_analytics_job_description_id_idx"
|
|
81
|
-
ON "analytics"."job_round_analytics"("job_description_id");
|
|
82
|
-
|
|
83
|
-
CREATE INDEX IF NOT EXISTS "pipeline_distribution_analytics_job_description_id_idx"
|
|
84
|
-
ON "analytics"."pipeline_distribution_analytics"("job_description_id");
|
|
85
|
-
|
|
86
|
-
CREATE INDEX IF NOT EXISTS "open_job_analytics_job_description_id_idx"
|
|
87
|
-
ON "analytics"."open_job_analytics"("job_description_id");
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
-- CreateEnum
|
|
2
|
-
CREATE TYPE "public"."SourceCategory" AS ENUM ('JOB_BOARD', 'REFERRAL', 'AGENCY', 'SOCIAL_MEDIA', 'CAREERS_PAGE', 'EVENT', 'OTHER');
|
|
3
|
-
|
|
4
|
-
-- CreateTable
|
|
5
|
-
CREATE TABLE "public"."Source" (
|
|
6
|
-
"id" TEXT NOT NULL,
|
|
7
|
-
"organisation_id" TEXT NOT NULL,
|
|
8
|
-
"name" TEXT NOT NULL,
|
|
9
|
-
"category" "public"."SourceCategory",
|
|
10
|
-
"parent_source_id" TEXT,
|
|
11
|
-
"colour" TEXT,
|
|
12
|
-
"description" TEXT,
|
|
13
|
-
"is_active" BOOLEAN NOT NULL DEFAULT true,
|
|
14
|
-
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
15
|
-
"updated_at" TIMESTAMP(3) NOT NULL,
|
|
16
|
-
|
|
17
|
-
CONSTRAINT "Source_pkey" PRIMARY KEY ("id")
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
-- CreateIndex
|
|
21
|
-
CREATE UNIQUE INDEX "Source_organisation_id_name_key" ON "public"."Source"("organisation_id", "name");
|
|
22
|
-
CREATE INDEX "Source_organisation_id_idx" ON "public"."Source"("organisation_id");
|
|
23
|
-
CREATE INDEX "Source_organisation_id_category_idx" ON "public"."Source"("organisation_id", "category");
|
|
24
|
-
CREATE INDEX "Source_organisation_id_is_active_idx" ON "public"."Source"("organisation_id", "is_active");
|
|
25
|
-
CREATE INDEX "Source_parent_source_id_idx" ON "public"."Source"("parent_source_id");
|
|
26
|
-
|
|
27
|
-
-- AddForeignKey
|
|
28
|
-
ALTER TABLE "public"."Source" ADD CONSTRAINT "Source_organisation_id_fkey" FOREIGN KEY ("organisation_id") REFERENCES "public"."Organisation"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
29
|
-
ALTER TABLE "public"."Source" ADD CONSTRAINT "Source_parent_source_id_fkey" FOREIGN KEY ("parent_source_id") REFERENCES "public"."Source"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
30
|
-
|
|
31
|
-
-- AlterTable
|
|
32
|
-
ALTER TABLE "public"."Application" ADD COLUMN "source_id" TEXT;
|
|
33
|
-
|
|
34
|
-
-- CreateIndex
|
|
35
|
-
CREATE INDEX "Application_source_id_idx" ON "public"."Application"("source_id");
|
|
36
|
-
|
|
37
|
-
-- AddForeignKey
|
|
38
|
-
ALTER TABLE "public"."Application" ADD CONSTRAINT "Application_source_id_fkey" FOREIGN KEY ("source_id") REFERENCES "public"."Source"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
package/prisma/schema/migrations/20260701120000_add_source_effectiveness_analytics/migration.sql
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
CREATE TABLE "analytics"."source_effectiveness_analytics" (
|
|
2
|
-
"id" TEXT NOT NULL,
|
|
3
|
-
"organisation_id" TEXT NOT NULL,
|
|
4
|
-
"job_description_id" TEXT NOT NULL,
|
|
5
|
-
"source_id" TEXT NOT NULL,
|
|
6
|
-
"source_name" TEXT NOT NULL,
|
|
7
|
-
"source_category" "public"."SourceCategory",
|
|
8
|
-
"source_colour" TEXT,
|
|
9
|
-
"job_code" TEXT,
|
|
10
|
-
"job_number" INTEGER,
|
|
11
|
-
"role_title" TEXT,
|
|
12
|
-
"hiring_manager_id" TEXT,
|
|
13
|
-
"applications_count" INTEGER NOT NULL DEFAULT 0,
|
|
14
|
-
"screened_count" INTEGER NOT NULL DEFAULT 0,
|
|
15
|
-
"evaluated_count" INTEGER NOT NULL DEFAULT 0,
|
|
16
|
-
"rejected_count" INTEGER NOT NULL DEFAULT 0,
|
|
17
|
-
"shortlisted_count" INTEGER NOT NULL DEFAULT 0,
|
|
18
|
-
"offered_count" INTEGER NOT NULL DEFAULT 0,
|
|
19
|
-
"offer_accepted_count" INTEGER NOT NULL DEFAULT 0,
|
|
20
|
-
"offer_declined_count" INTEGER NOT NULL DEFAULT 0,
|
|
21
|
-
"withdrawn_count" INTEGER NOT NULL DEFAULT 0,
|
|
22
|
-
"hired_count" INTEGER NOT NULL DEFAULT 0,
|
|
23
|
-
"total_fit_score" DOUBLE PRECISION NOT NULL DEFAULT 0,
|
|
24
|
-
"fit_score_sample_count" INTEGER NOT NULL DEFAULT 0,
|
|
25
|
-
"average_fit_score" DOUBLE PRECISION,
|
|
26
|
-
"updated_at" TIMESTAMP(3) NOT NULL,
|
|
27
|
-
|
|
28
|
-
CONSTRAINT "source_effectiveness_analytics_pkey" PRIMARY KEY ("id")
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
CREATE UNIQUE INDEX "source_effectiveness_analytics_organisation_id_job_descripti_key"
|
|
32
|
-
ON "analytics"."source_effectiveness_analytics"("organisation_id", "job_description_id", "source_id");
|
|
33
|
-
CREATE INDEX "source_effectiveness_analytics_organisation_id_idx"
|
|
34
|
-
ON "analytics"."source_effectiveness_analytics"("organisation_id");
|
|
35
|
-
CREATE INDEX "source_effectiveness_analytics_organisation_id_source_id_idx"
|
|
36
|
-
ON "analytics"."source_effectiveness_analytics"("organisation_id", "source_id");
|
|
37
|
-
CREATE INDEX "source_effectiveness_analytics_organisation_id_hiring_manag_idx"
|
|
38
|
-
ON "analytics"."source_effectiveness_analytics"("organisation_id", "hiring_manager_id");
|
|
39
|
-
CREATE INDEX "source_effectiveness_analytics_job_description_id_idx"
|
|
40
|
-
ON "analytics"."source_effectiveness_analytics"("job_description_id");
|