@adaptware/eagles-db 0.4.22 → 0.4.23
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/README.md +15 -15
- package/bin/db-cli.js +91 -91
- package/client/edge.js +16 -8
- package/client/index-browser.js +8 -0
- package/client/index.d.ts +232 -7
- package/client/index.js +22 -14
- package/client/libquery_engine-linux-arm64-openssl-1.1.x.so.node +0 -0
- package/client/package.json +1 -1
- package/client/{libquery_engine-darwin-arm64.dylib.node → query_engine-windows.dll.node} +0 -0
- package/client/schema.prisma +20 -10
- package/client/wasm.js +16 -8
- package/package.json +58 -58
- package/prisma/schema/CandidateQuestionResponse.prisma +24 -24
- package/prisma/schema/UserRole.prisma +20 -20
- package/prisma/schema/action.prisma +35 -35
- package/prisma/schema/activityLog.prisma +22 -22
- package/prisma/schema/applications.prisma +57 -56
- package/prisma/schema/approval.prisma +14 -14
- package/prisma/schema/assessment.prisma +39 -39
- package/prisma/schema/assessmentLibrary.prisma +21 -21
- package/prisma/schema/assessmentQuestion.prisma +17 -17
- package/prisma/schema/assignment.prisma +48 -48
- package/prisma/schema/assignmentLibrary.prisma +20 -20
- package/prisma/schema/authModule.prisma +36 -36
- package/prisma/schema/budget.prisma +38 -38
- package/prisma/schema/calendly.prisma +18 -18
- package/prisma/schema/candidateProfile.prisma +26 -26
- package/prisma/schema/communication.prisma +156 -156
- package/prisma/schema/contactUs.prisma +12 -12
- package/prisma/schema/document.prisma +37 -37
- package/prisma/schema/evaluationPlan.prisma +83 -74
- package/prisma/schema/feedback.prisma +18 -18
- package/prisma/schema/fitCheck.prisma +58 -58
- package/prisma/schema/google.prisma +16 -16
- package/prisma/schema/integration.prisma +98 -98
- package/prisma/schema/interview.prisma +112 -112
- package/prisma/schema/interviewNotes.prisma +17 -17
- package/prisma/schema/jobApplicationFields.prisma +37 -37
- package/prisma/schema/jobApplicationResponse.prisma +33 -33
- package/prisma/schema/jobApplicationTemplate.prisma +30 -30
- package/prisma/schema/jobDescription.prisma +57 -57
- package/prisma/schema/jobDescriptionData.prisma +15 -15
- package/prisma/schema/jobProfile.prisma +56 -56
- package/prisma/schema/liveAnalysis.prisma +17 -17
- package/prisma/schema/message.prisma +15 -15
- package/prisma/schema/migrations/20260415120000_remove_job_profile_current_phase/migration.sql +2 -2
- package/prisma/schema/migrations/20260422120000_add_integration_provider_zoom/migration.sql +2 -2
- package/prisma/schema/migrations/20260422140000_add_zoom_meeting_tables/migration.sql +57 -57
- package/prisma/schema/migrations/20260422180000_add_zoom_webhook_event/migration.sql +18 -18
- package/prisma/schema/migrations/20260423140000_add_interview_platform/migration.sql +6 -6
- package/prisma/schema/migrations/20260423150000_remove_interview_zoom_topic/migration.sql +2 -2
- package/prisma/schema/migrations/20260423160000_zoom_meeting_uuid/migration.sql +4 -4
- package/prisma/schema/migrations/20260423170000_zoom_meeting_uuid_prisma_sync/migration.sql +2 -2
- package/prisma/schema/migrations/20260424120000_auth_module_user_provider_unique/migration.sql +5 -5
- package/prisma/schema/migrations/20260424130000_zoom_meeting_zoom_host_user_id/migration.sql +6 -6
- package/prisma/schema/migrations/20260425100000_zoom_participant_user_enum/migration.sql +22 -22
- package/prisma/schema/migrations/20260425110000_zoom_participant_zoom_id_required/migration.sql +13 -13
- package/prisma/schema/migrations/20260425120000_zoom_participant_id_nullable/migration.sql +4 -4
- package/prisma/schema/migrations/20260429140000_drop_evaluation_plan_job_order_unique/migration.sql +5 -5
- package/prisma/schema/migrations/20260429180000_eval_plan_timeline_optional_ongoing_duration/migration.sql +15 -15
- package/prisma/schema/migrations/20260430120000_drop_assessment_library_metadata_fields/migration.sql +8 -8
- package/prisma/schema/migrations/20260430140000_drop_question_question_type/migration.sql +5 -5
- package/prisma/schema/migrations/20260513120000_add_organisation_config/migration.sql +56 -56
- package/prisma/schema/migrations/20260514120000_dedupe_organisation_config/migration.sql +20 -20
- package/prisma/schema/migrations/20260515120000_add_interview_ai_assistance_mode/migration.sql +5 -5
- package/prisma/schema/migrations/20260626120000_add_evaluation_plan_share_scope/migration.sql +14 -0
- package/prisma/schema/migrations/20260626140000_add_evaluation_comment/migration.sql +2 -0
- package/prisma/schema/migrations/migration_lock.toml +3 -3
- package/prisma/schema/notes.prisma +19 -19
- package/prisma/schema/ongoingEvaluation.prisma +72 -72
- package/prisma/schema/organisation.prisma +57 -57
- package/prisma/schema/organisationConfig.prisma +12 -12
- package/prisma/schema/permission.prisma +13 -13
- package/prisma/schema/promise.prisma +39 -39
- package/prisma/schema/questions.prisma +28 -28
- package/prisma/schema/refreshToken.prisma +10 -10
- package/prisma/schema/resume.prisma +34 -34
- package/prisma/schema/resumeData.prisma +15 -15
- package/prisma/schema/schema.prisma +16 -16
- package/prisma/schema/suggestion.prisma +20 -20
- package/prisma/schema/transcript.prisma +25 -25
- package/prisma/schema/user.prisma +93 -93
- package/prisma/schema/userProfile.prisma +15 -15
- package/prisma/schema/zoomMeeting.prisma +79 -79
- package/prisma/.DS_Store +0 -0
- package/prisma/schema/migrations/20260519120000_interview_deadline/migration.sql +0 -2
- package/prisma/schema/migrations/20260520120000_interview_duration_drop_deadline/migration.sql +0 -30
- package/prisma/schema/migrations/20260602120000_resume_file_hash_drop_unique/migration.sql +0 -2
- package/prisma/schema/migrations/20260603120000_job_application_field_is_mandatory/migration.sql +0 -2
- package/prisma/schema/migrations/20260604120000_job_application_response_updated_by_organisation/migration.sql +0 -2
- package/prisma/schema/migrations/20260605120000_drop_document_application_id/migration.sql +0 -3
- package/prisma/schema/migrations/20260610120000_jaf_template_model/migration.sql +0 -70
- package/prisma/schema/migrations/20260610130000_assignment_document_fks/migration.sql +0 -15
- package/prisma/schema/migrations/20260610140000_jaf_draft_activation/migration.sql +0 -12
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
-- CreateTable
|
|
2
|
-
CREATE TABLE "ZoomMeeting" (
|
|
3
|
-
"id" TEXT NOT NULL,
|
|
4
|
-
"interview_id" TEXT NOT NULL,
|
|
5
|
-
"zoom_meeting_id" TEXT NOT NULL,
|
|
6
|
-
"meeting_number" TEXT NOT NULL,
|
|
7
|
-
"join_url" TEXT NOT NULL,
|
|
8
|
-
"start_url" TEXT,
|
|
9
|
-
"password" TEXT,
|
|
10
|
-
"topic" TEXT,
|
|
11
|
-
"scheduled_start_time" TIMESTAMP(3),
|
|
12
|
-
"scheduled_end_time" TIMESTAMP(3),
|
|
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
|
-
"created_by" TEXT NOT NULL,
|
|
17
|
-
"updated_by" TEXT NOT NULL,
|
|
18
|
-
|
|
19
|
-
CONSTRAINT "ZoomMeeting_pkey" PRIMARY KEY ("id")
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
-- CreateTable
|
|
23
|
-
CREATE TABLE "ZoomMeetingParticipant" (
|
|
24
|
-
"id" TEXT NOT NULL,
|
|
25
|
-
"zoom_meeting_row_id" TEXT NOT NULL,
|
|
26
|
-
"zoom_participant_id" TEXT,
|
|
27
|
-
"user_name" TEXT,
|
|
28
|
-
"user_email" TEXT,
|
|
29
|
-
"role" TEXT,
|
|
30
|
-
"join_time" TIMESTAMP(3),
|
|
31
|
-
"leave_time" TIMESTAMP(3),
|
|
32
|
-
"is_active" BOOLEAN NOT NULL DEFAULT true,
|
|
33
|
-
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
34
|
-
"updated_at" TIMESTAMP(3) NOT NULL,
|
|
35
|
-
"created_by" TEXT NOT NULL,
|
|
36
|
-
"updated_by" TEXT NOT NULL,
|
|
37
|
-
|
|
38
|
-
CONSTRAINT "ZoomMeetingParticipant_pkey" PRIMARY KEY ("id")
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
-- CreateIndex
|
|
42
|
-
CREATE UNIQUE INDEX "ZoomMeeting_interview_id_key" ON "ZoomMeeting"("interview_id");
|
|
43
|
-
|
|
44
|
-
-- CreateIndex
|
|
45
|
-
CREATE INDEX "ZoomMeeting_interview_id_idx" ON "ZoomMeeting"("interview_id");
|
|
46
|
-
|
|
47
|
-
-- CreateIndex
|
|
48
|
-
CREATE INDEX "ZoomMeeting_zoom_meeting_id_idx" ON "ZoomMeeting"("zoom_meeting_id");
|
|
49
|
-
|
|
50
|
-
-- CreateIndex
|
|
51
|
-
CREATE INDEX "ZoomMeetingParticipant_zoom_meeting_row_id_idx" ON "ZoomMeetingParticipant"("zoom_meeting_row_id");
|
|
52
|
-
|
|
53
|
-
-- AddForeignKey
|
|
54
|
-
ALTER TABLE "ZoomMeeting" ADD CONSTRAINT "ZoomMeeting_interview_id_fkey" FOREIGN KEY ("interview_id") REFERENCES "Interview"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
55
|
-
|
|
56
|
-
-- AddForeignKey
|
|
57
|
-
ALTER TABLE "ZoomMeetingParticipant" ADD CONSTRAINT "ZoomMeetingParticipant_zoom_meeting_row_id_fkey" FOREIGN KEY ("zoom_meeting_row_id") REFERENCES "ZoomMeeting"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
1
|
+
-- CreateTable
|
|
2
|
+
CREATE TABLE "ZoomMeeting" (
|
|
3
|
+
"id" TEXT NOT NULL,
|
|
4
|
+
"interview_id" TEXT NOT NULL,
|
|
5
|
+
"zoom_meeting_id" TEXT NOT NULL,
|
|
6
|
+
"meeting_number" TEXT NOT NULL,
|
|
7
|
+
"join_url" TEXT NOT NULL,
|
|
8
|
+
"start_url" TEXT,
|
|
9
|
+
"password" TEXT,
|
|
10
|
+
"topic" TEXT,
|
|
11
|
+
"scheduled_start_time" TIMESTAMP(3),
|
|
12
|
+
"scheduled_end_time" TIMESTAMP(3),
|
|
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
|
+
"created_by" TEXT NOT NULL,
|
|
17
|
+
"updated_by" TEXT NOT NULL,
|
|
18
|
+
|
|
19
|
+
CONSTRAINT "ZoomMeeting_pkey" PRIMARY KEY ("id")
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
-- CreateTable
|
|
23
|
+
CREATE TABLE "ZoomMeetingParticipant" (
|
|
24
|
+
"id" TEXT NOT NULL,
|
|
25
|
+
"zoom_meeting_row_id" TEXT NOT NULL,
|
|
26
|
+
"zoom_participant_id" TEXT,
|
|
27
|
+
"user_name" TEXT,
|
|
28
|
+
"user_email" TEXT,
|
|
29
|
+
"role" TEXT,
|
|
30
|
+
"join_time" TIMESTAMP(3),
|
|
31
|
+
"leave_time" TIMESTAMP(3),
|
|
32
|
+
"is_active" BOOLEAN NOT NULL DEFAULT true,
|
|
33
|
+
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
34
|
+
"updated_at" TIMESTAMP(3) NOT NULL,
|
|
35
|
+
"created_by" TEXT NOT NULL,
|
|
36
|
+
"updated_by" TEXT NOT NULL,
|
|
37
|
+
|
|
38
|
+
CONSTRAINT "ZoomMeetingParticipant_pkey" PRIMARY KEY ("id")
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
-- CreateIndex
|
|
42
|
+
CREATE UNIQUE INDEX "ZoomMeeting_interview_id_key" ON "ZoomMeeting"("interview_id");
|
|
43
|
+
|
|
44
|
+
-- CreateIndex
|
|
45
|
+
CREATE INDEX "ZoomMeeting_interview_id_idx" ON "ZoomMeeting"("interview_id");
|
|
46
|
+
|
|
47
|
+
-- CreateIndex
|
|
48
|
+
CREATE INDEX "ZoomMeeting_zoom_meeting_id_idx" ON "ZoomMeeting"("zoom_meeting_id");
|
|
49
|
+
|
|
50
|
+
-- CreateIndex
|
|
51
|
+
CREATE INDEX "ZoomMeetingParticipant_zoom_meeting_row_id_idx" ON "ZoomMeetingParticipant"("zoom_meeting_row_id");
|
|
52
|
+
|
|
53
|
+
-- AddForeignKey
|
|
54
|
+
ALTER TABLE "ZoomMeeting" ADD CONSTRAINT "ZoomMeeting_interview_id_fkey" FOREIGN KEY ("interview_id") REFERENCES "Interview"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
55
|
+
|
|
56
|
+
-- AddForeignKey
|
|
57
|
+
ALTER TABLE "ZoomMeetingParticipant" ADD CONSTRAINT "ZoomMeetingParticipant_zoom_meeting_row_id_fkey" FOREIGN KEY ("zoom_meeting_row_id") REFERENCES "ZoomMeeting"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
-- CreateTable
|
|
2
|
-
CREATE TABLE "ZoomWebhookEvent" (
|
|
3
|
-
"id" TEXT NOT NULL,
|
|
4
|
-
"dedupe_key" TEXT NOT NULL,
|
|
5
|
-
"event" TEXT NOT NULL,
|
|
6
|
-
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
7
|
-
|
|
8
|
-
CONSTRAINT "ZoomWebhookEvent_pkey" PRIMARY KEY ("id")
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
-- CreateIndex
|
|
12
|
-
CREATE UNIQUE INDEX "ZoomWebhookEvent_dedupe_key_key" ON "ZoomWebhookEvent"("dedupe_key");
|
|
13
|
-
|
|
14
|
-
-- CreateIndex
|
|
15
|
-
CREATE INDEX "ZoomWebhookEvent_event_idx" ON "ZoomWebhookEvent"("event");
|
|
16
|
-
|
|
17
|
-
-- CreateIndex
|
|
18
|
-
CREATE INDEX "ZoomWebhookEvent_created_at_idx" ON "ZoomWebhookEvent"("created_at");
|
|
1
|
+
-- CreateTable
|
|
2
|
+
CREATE TABLE "ZoomWebhookEvent" (
|
|
3
|
+
"id" TEXT NOT NULL,
|
|
4
|
+
"dedupe_key" TEXT NOT NULL,
|
|
5
|
+
"event" TEXT NOT NULL,
|
|
6
|
+
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
7
|
+
|
|
8
|
+
CONSTRAINT "ZoomWebhookEvent_pkey" PRIMARY KEY ("id")
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
-- CreateIndex
|
|
12
|
+
CREATE UNIQUE INDEX "ZoomWebhookEvent_dedupe_key_key" ON "ZoomWebhookEvent"("dedupe_key");
|
|
13
|
+
|
|
14
|
+
-- CreateIndex
|
|
15
|
+
CREATE INDEX "ZoomWebhookEvent_event_idx" ON "ZoomWebhookEvent"("event");
|
|
16
|
+
|
|
17
|
+
-- CreateIndex
|
|
18
|
+
CREATE INDEX "ZoomWebhookEvent_created_at_idx" ON "ZoomWebhookEvent"("created_at");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
-- CreateEnum
|
|
2
|
-
CREATE TYPE "InterviewPlatform" AS ENUM ('TREADSPACE', 'ZOOM');
|
|
3
|
-
|
|
4
|
-
-- AlterTable
|
|
5
|
-
ALTER TABLE "Interview" ADD COLUMN "interview_platform" "InterviewPlatform" NOT NULL DEFAULT 'TREADSPACE';
|
|
6
|
-
ALTER TABLE "Interview" ADD COLUMN "zoom_topic" TEXT;
|
|
1
|
+
-- CreateEnum
|
|
2
|
+
CREATE TYPE "InterviewPlatform" AS ENUM ('TREADSPACE', 'ZOOM');
|
|
3
|
+
|
|
4
|
+
-- AlterTable
|
|
5
|
+
ALTER TABLE "Interview" ADD COLUMN "interview_platform" "InterviewPlatform" NOT NULL DEFAULT 'TREADSPACE';
|
|
6
|
+
ALTER TABLE "Interview" ADD COLUMN "zoom_topic" TEXT;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
-- AlterTable
|
|
2
|
-
ALTER TABLE "Interview" DROP COLUMN IF EXISTS "zoom_topic";
|
|
1
|
+
-- AlterTable
|
|
2
|
+
ALTER TABLE "Interview" DROP COLUMN IF EXISTS "zoom_topic";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
-- Zoom meeting instance UUID for RTMS `meeting.rtms_started` correlation (webhook `meeting_uuid`).
|
|
2
|
-
ALTER TABLE "ZoomMeeting" ADD COLUMN IF NOT EXISTS "zoom_meeting_uuid" TEXT;
|
|
3
|
-
|
|
4
|
-
CREATE INDEX IF NOT EXISTS "ZoomMeeting_zoom_meeting_uuid_idx" ON "ZoomMeeting"("zoom_meeting_uuid");
|
|
1
|
+
-- Zoom meeting instance UUID for RTMS `meeting.rtms_started` correlation (webhook `meeting_uuid`).
|
|
2
|
+
ALTER TABLE "ZoomMeeting" ADD COLUMN IF NOT EXISTS "zoom_meeting_uuid" TEXT;
|
|
3
|
+
|
|
4
|
+
CREATE INDEX IF NOT EXISTS "ZoomMeeting_zoom_meeting_uuid_idx" ON "ZoomMeeting"("zoom_meeting_uuid");
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
-- No-op migration (keeps migration history contiguous; safe if already applied in DB).
|
|
2
|
-
SELECT 1;
|
|
1
|
+
-- No-op migration (keeps migration history contiguous; safe if already applied in DB).
|
|
2
|
+
SELECT 1;
|
package/prisma/schema/migrations/20260424120000_auth_module_user_provider_unique/migration.sql
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
-- AlterTable
|
|
2
|
-
ALTER TABLE "AuthModule" ADD COLUMN "metadata" JSONB NOT NULL DEFAULT '{}';
|
|
3
|
-
|
|
4
|
-
-- CreateIndex
|
|
5
|
-
CREATE UNIQUE INDEX "AuthModule_user_id_provider_key" ON "AuthModule"("user_id", "provider");
|
|
1
|
+
-- AlterTable
|
|
2
|
+
ALTER TABLE "AuthModule" ADD COLUMN "metadata" JSONB NOT NULL DEFAULT '{}';
|
|
3
|
+
|
|
4
|
+
-- CreateIndex
|
|
5
|
+
CREATE UNIQUE INDEX "AuthModule_user_id_provider_key" ON "AuthModule"("user_id", "provider");
|
package/prisma/schema/migrations/20260424130000_zoom_meeting_zoom_host_user_id/migration.sql
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
-- AlterTable
|
|
2
|
-
ALTER TABLE "ZoomMeeting" ADD COLUMN "zoom_host_user_id" TEXT;
|
|
3
|
-
|
|
4
|
-
UPDATE "ZoomMeeting" SET "zoom_host_user_id" = "created_by";
|
|
5
|
-
|
|
6
|
-
ALTER TABLE "ZoomMeeting" ALTER COLUMN "zoom_host_user_id" SET NOT NULL;
|
|
1
|
+
-- AlterTable
|
|
2
|
+
ALTER TABLE "ZoomMeeting" ADD COLUMN "zoom_host_user_id" TEXT;
|
|
3
|
+
|
|
4
|
+
UPDATE "ZoomMeeting" SET "zoom_host_user_id" = "created_by";
|
|
5
|
+
|
|
6
|
+
ALTER TABLE "ZoomMeeting" ALTER COLUMN "zoom_host_user_id" SET NOT NULL;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
-- CreateEnum
|
|
2
|
-
CREATE TYPE "ZoomMeetingParticipantRole" AS ENUM ('CANDIDATE', 'INTERVIEWER');
|
|
3
|
-
|
|
4
|
-
-- Participant rows are re-derived on the next Zoom meeting upsert; old webhook denormalized rows are dropped.
|
|
5
|
-
TRUNCATE TABLE "ZoomMeetingParticipant";
|
|
6
|
-
|
|
7
|
-
-- AlterTable
|
|
8
|
-
ALTER TABLE "ZoomMeetingParticipant" DROP COLUMN "zoom_participant_id",
|
|
9
|
-
DROP COLUMN "user_name",
|
|
10
|
-
DROP COLUMN "user_email",
|
|
11
|
-
DROP COLUMN "join_time",
|
|
12
|
-
DROP COLUMN "leave_time",
|
|
13
|
-
DROP COLUMN "role";
|
|
14
|
-
|
|
15
|
-
ALTER TABLE "ZoomMeetingParticipant" ADD COLUMN "role" "ZoomMeetingParticipantRole" NOT NULL;
|
|
16
|
-
ALTER TABLE "ZoomMeetingParticipant" ADD COLUMN "user_id" TEXT NOT NULL;
|
|
17
|
-
|
|
18
|
-
-- AddForeignKey
|
|
19
|
-
ALTER TABLE "ZoomMeetingParticipant" ADD CONSTRAINT "ZoomMeetingParticipant_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
20
|
-
|
|
21
|
-
-- CreateIndex
|
|
22
|
-
CREATE INDEX "ZoomMeetingParticipant_user_id_idx" ON "ZoomMeetingParticipant"("user_id");
|
|
1
|
+
-- CreateEnum
|
|
2
|
+
CREATE TYPE "ZoomMeetingParticipantRole" AS ENUM ('CANDIDATE', 'INTERVIEWER');
|
|
3
|
+
|
|
4
|
+
-- Participant rows are re-derived on the next Zoom meeting upsert; old webhook denormalized rows are dropped.
|
|
5
|
+
TRUNCATE TABLE "ZoomMeetingParticipant";
|
|
6
|
+
|
|
7
|
+
-- AlterTable
|
|
8
|
+
ALTER TABLE "ZoomMeetingParticipant" DROP COLUMN "zoom_participant_id",
|
|
9
|
+
DROP COLUMN "user_name",
|
|
10
|
+
DROP COLUMN "user_email",
|
|
11
|
+
DROP COLUMN "join_time",
|
|
12
|
+
DROP COLUMN "leave_time",
|
|
13
|
+
DROP COLUMN "role";
|
|
14
|
+
|
|
15
|
+
ALTER TABLE "ZoomMeetingParticipant" ADD COLUMN "role" "ZoomMeetingParticipantRole" NOT NULL;
|
|
16
|
+
ALTER TABLE "ZoomMeetingParticipant" ADD COLUMN "user_id" TEXT NOT NULL;
|
|
17
|
+
|
|
18
|
+
-- AddForeignKey
|
|
19
|
+
ALTER TABLE "ZoomMeetingParticipant" ADD CONSTRAINT "ZoomMeetingParticipant_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
20
|
+
|
|
21
|
+
-- CreateIndex
|
|
22
|
+
CREATE INDEX "ZoomMeetingParticipant_user_id_idx" ON "ZoomMeetingParticipant"("user_id");
|
package/prisma/schema/migrations/20260425110000_zoom_participant_zoom_id_required/migration.sql
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
-- AlterTable
|
|
2
|
-
ALTER TABLE "ZoomMeetingParticipant" ADD COLUMN "zoom_participant_id" TEXT NOT NULL DEFAULT '';
|
|
3
|
-
|
|
4
|
-
UPDATE "ZoomMeetingParticipant" zmp
|
|
5
|
-
SET "zoom_participant_id" = COALESCE(NULLIF(TRIM(am."provider_account_id"), ''), '')
|
|
6
|
-
FROM "AuthModule" am
|
|
7
|
-
WHERE am."user_id" = zmp."user_id"
|
|
8
|
-
AND am."provider"::text = 'ZOOM'
|
|
9
|
-
AND am."is_active" = true;
|
|
10
|
-
|
|
11
|
-
ALTER TABLE "ZoomMeetingParticipant" ALTER COLUMN "zoom_participant_id" DROP DEFAULT;
|
|
12
|
-
|
|
13
|
-
CREATE INDEX "ZoomMeetingParticipant_zoom_participant_id_idx" ON "ZoomMeetingParticipant"("zoom_participant_id");
|
|
1
|
+
-- AlterTable
|
|
2
|
+
ALTER TABLE "ZoomMeetingParticipant" ADD COLUMN "zoom_participant_id" TEXT NOT NULL DEFAULT '';
|
|
3
|
+
|
|
4
|
+
UPDATE "ZoomMeetingParticipant" zmp
|
|
5
|
+
SET "zoom_participant_id" = COALESCE(NULLIF(TRIM(am."provider_account_id"), ''), '')
|
|
6
|
+
FROM "AuthModule" am
|
|
7
|
+
WHERE am."user_id" = zmp."user_id"
|
|
8
|
+
AND am."provider"::text = 'ZOOM'
|
|
9
|
+
AND am."is_active" = true;
|
|
10
|
+
|
|
11
|
+
ALTER TABLE "ZoomMeetingParticipant" ALTER COLUMN "zoom_participant_id" DROP DEFAULT;
|
|
12
|
+
|
|
13
|
+
CREATE INDEX "ZoomMeetingParticipant_zoom_participant_id_idx" ON "ZoomMeetingParticipant"("zoom_participant_id");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
-- Optional: only present when that User has Zoom OAuth linked (typically interviewer; often unknown for candidate).
|
|
2
|
-
UPDATE "ZoomMeetingParticipant" SET "zoom_participant_id" = NULL WHERE "zoom_participant_id" = '';
|
|
3
|
-
|
|
4
|
-
ALTER TABLE "ZoomMeetingParticipant" ALTER COLUMN "zoom_participant_id" DROP NOT NULL;
|
|
1
|
+
-- Optional: only present when that User has Zoom OAuth linked (typically interviewer; often unknown for candidate).
|
|
2
|
+
UPDATE "ZoomMeetingParticipant" SET "zoom_participant_id" = NULL WHERE "zoom_participant_id" = '';
|
|
3
|
+
|
|
4
|
+
ALTER TABLE "ZoomMeetingParticipant" ALTER COLUMN "zoom_participant_id" DROP NOT NULL;
|
package/prisma/schema/migrations/20260429140000_drop_evaluation_plan_job_order_unique/migration.sql
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
-- DropUnique: allows reorder/swap without a two-phase order_no dance; ordering is enforced in app logic.
|
|
2
|
-
ALTER TABLE "EvaluationPlan" DROP CONSTRAINT IF EXISTS "EvaluationPlan_job_description_id_order_no_key";
|
|
3
|
-
|
|
4
|
-
-- Non-unique index for lookups by job + order (e.g. swap).
|
|
5
|
-
CREATE INDEX "EvaluationPlan_job_description_id_order_no_idx" ON "EvaluationPlan"("job_description_id", "order_no");
|
|
1
|
+
-- DropUnique: allows reorder/swap without a two-phase order_no dance; ordering is enforced in app logic.
|
|
2
|
+
ALTER TABLE "EvaluationPlan" DROP CONSTRAINT IF EXISTS "EvaluationPlan_job_description_id_order_no_key";
|
|
3
|
+
|
|
4
|
+
-- Non-unique index for lookups by job + order (e.g. swap).
|
|
5
|
+
CREATE INDEX "EvaluationPlan_job_description_id_order_no_idx" ON "EvaluationPlan"("job_description_id", "order_no");
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
-- EvaluationPlan.timeline optional (legacy column; app uses duration/deadline/duration_unit).
|
|
2
|
-
ALTER TABLE "EvaluationPlan" ALTER COLUMN "timeline" DROP NOT NULL;
|
|
3
|
-
|
|
4
|
-
-- OngoingEvaluation: denormalized duration fields; migrate legacy timeline into duration (minutes) then drop timeline.
|
|
5
|
-
ALTER TABLE "OngoingEvaluation" ADD COLUMN "duration" INTEGER;
|
|
6
|
-
ALTER TABLE "OngoingEvaluation" ADD COLUMN "deadline" INTEGER;
|
|
7
|
-
ALTER TABLE "OngoingEvaluation" ADD COLUMN "duration_unit" "DurationUnit";
|
|
8
|
-
|
|
9
|
-
UPDATE "OngoingEvaluation"
|
|
10
|
-
SET
|
|
11
|
-
"duration" = "timeline",
|
|
12
|
-
"duration_unit" = 'MINUTES'::"DurationUnit"
|
|
13
|
-
WHERE "timeline" IS NOT NULL AND "duration" IS NULL;
|
|
14
|
-
|
|
15
|
-
ALTER TABLE "OngoingEvaluation" DROP COLUMN IF EXISTS "timeline";
|
|
1
|
+
-- EvaluationPlan.timeline optional (legacy column; app uses duration/deadline/duration_unit).
|
|
2
|
+
ALTER TABLE "EvaluationPlan" ALTER COLUMN "timeline" DROP NOT NULL;
|
|
3
|
+
|
|
4
|
+
-- OngoingEvaluation: denormalized duration fields; migrate legacy timeline into duration (minutes) then drop timeline.
|
|
5
|
+
ALTER TABLE "OngoingEvaluation" ADD COLUMN "duration" INTEGER;
|
|
6
|
+
ALTER TABLE "OngoingEvaluation" ADD COLUMN "deadline" INTEGER;
|
|
7
|
+
ALTER TABLE "OngoingEvaluation" ADD COLUMN "duration_unit" "DurationUnit";
|
|
8
|
+
|
|
9
|
+
UPDATE "OngoingEvaluation"
|
|
10
|
+
SET
|
|
11
|
+
"duration" = "timeline",
|
|
12
|
+
"duration_unit" = 'MINUTES'::"DurationUnit"
|
|
13
|
+
WHERE "timeline" IS NOT NULL AND "duration" IS NULL;
|
|
14
|
+
|
|
15
|
+
ALTER TABLE "OngoingEvaluation" DROP COLUMN IF EXISTS "timeline";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
-- Remove unused AssessmentLibrary metadata columns.
|
|
2
|
-
ALTER TABLE "AssessmentLibrary" DROP COLUMN IF EXISTS "assessment_type";
|
|
3
|
-
ALTER TABLE "AssessmentLibrary" DROP COLUMN IF EXISTS "description";
|
|
4
|
-
ALTER TABLE "AssessmentLibrary" DROP COLUMN IF EXISTS "assessment_category";
|
|
5
|
-
ALTER TABLE "AssessmentLibrary" DROP COLUMN IF EXISTS "created_by_ai";
|
|
6
|
-
|
|
7
|
-
-- Enum only referenced by dropped column.
|
|
8
|
-
DROP TYPE IF EXISTS "AssessmentCategory";
|
|
1
|
+
-- Remove unused AssessmentLibrary metadata columns.
|
|
2
|
+
ALTER TABLE "AssessmentLibrary" DROP COLUMN IF EXISTS "assessment_type";
|
|
3
|
+
ALTER TABLE "AssessmentLibrary" DROP COLUMN IF EXISTS "description";
|
|
4
|
+
ALTER TABLE "AssessmentLibrary" DROP COLUMN IF EXISTS "assessment_category";
|
|
5
|
+
ALTER TABLE "AssessmentLibrary" DROP COLUMN IF EXISTS "created_by_ai";
|
|
6
|
+
|
|
7
|
+
-- Enum only referenced by dropped column.
|
|
8
|
+
DROP TYPE IF EXISTS "AssessmentCategory";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
-- DropQuestion.question_type and enum QuestionType (replaced by structure-based inference in app code)
|
|
2
|
-
|
|
3
|
-
ALTER TABLE "Question" DROP COLUMN IF EXISTS "question_type";
|
|
4
|
-
|
|
5
|
-
DROP TYPE IF EXISTS "QuestionType";
|
|
1
|
+
-- DropQuestion.question_type and enum QuestionType (replaced by structure-based inference in app code)
|
|
2
|
+
|
|
3
|
+
ALTER TABLE "Question" DROP COLUMN IF EXISTS "question_type";
|
|
4
|
+
|
|
5
|
+
DROP TYPE IF EXISTS "QuestionType";
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
-- CreateTable
|
|
2
|
-
CREATE TABLE IF NOT EXISTS "organisationConfig" (
|
|
3
|
-
"id" TEXT NOT NULL,
|
|
4
|
-
"organisation_id" TEXT NOT NULL,
|
|
5
|
-
"config_key" TEXT NOT NULL,
|
|
6
|
-
"value" JSONB NOT NULL,
|
|
7
|
-
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
8
|
-
"updated_at" TIMESTAMP(3) NOT NULL,
|
|
9
|
-
|
|
10
|
-
CONSTRAINT "organisationConfig_pkey" PRIMARY KEY ("id")
|
|
11
|
-
);
|
|
12
|
-
|
|
13
|
-
-- CreateIndex (idempotent for re-runs)
|
|
14
|
-
CREATE UNIQUE INDEX IF NOT EXISTS "organisationConfig_organisation_id_config_key_key" ON "organisationConfig"("organisation_id", "config_key");
|
|
15
|
-
|
|
16
|
-
-- AddForeignKey (ignore if exists)
|
|
17
|
-
DO $$
|
|
18
|
-
BEGIN
|
|
19
|
-
IF NOT EXISTS (
|
|
20
|
-
SELECT 1 FROM pg_constraint WHERE conname = 'organisationConfig_organisation_id_fkey'
|
|
21
|
-
) THEN
|
|
22
|
-
ALTER TABLE "organisationConfig" ADD CONSTRAINT "organisationConfig_organisation_id_fkey" FOREIGN KEY ("organisation_id") REFERENCES "Organisation"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
23
|
-
END IF;
|
|
24
|
-
END $$;
|
|
25
|
-
|
|
26
|
-
-- Backfill from legacy column when present, then drop column.
|
|
27
|
-
-- IMPORTANT: Backfill runs only while `ai_assisted_interview_visible` still exists on
|
|
28
|
-
-- `"Organisation"`. If this migration applied once successfully, revoke + redeploy will
|
|
29
|
-
-- NOT re-insert—a column restore or manual INSERT is needed for replay scenarios.
|
|
30
|
-
DO $$
|
|
31
|
-
BEGIN
|
|
32
|
-
IF EXISTS (
|
|
33
|
-
SELECT 1
|
|
34
|
-
FROM pg_catalog.pg_attribute a
|
|
35
|
-
INNER JOIN pg_catalog.pg_class c ON c.oid = a.attrelid
|
|
36
|
-
INNER JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
|
|
37
|
-
WHERE n.nspname = ANY (current_schemas(true))
|
|
38
|
-
AND c.relkind = 'r'
|
|
39
|
-
AND c.relname = 'Organisation'
|
|
40
|
-
AND a.attname = 'ai_assisted_interview_visible'
|
|
41
|
-
AND a.attnum > 0
|
|
42
|
-
AND NOT a.attisdropped
|
|
43
|
-
) THEN
|
|
44
|
-
INSERT INTO "organisationConfig" ("id", "organisation_id", "config_key", "value", "created_at", "updated_at")
|
|
45
|
-
SELECT gen_random_uuid()::text, "id", 'ai_assisted_interview_visible', to_jsonb(false), CURRENT_TIMESTAMP, CURRENT_TIMESTAMP
|
|
46
|
-
FROM "Organisation"
|
|
47
|
-
WHERE "ai_assisted_interview_visible" IS FALSE
|
|
48
|
-
ON CONFLICT ("organisation_id", "config_key") DO NOTHING;
|
|
49
|
-
|
|
50
|
-
ALTER TABLE "Organisation" DROP COLUMN "ai_assisted_interview_visible";
|
|
51
|
-
|
|
52
|
-
RAISE NOTICE 'organisationConfig: backfilled from ai_assisted_interview_visible and dropped legacy column.';
|
|
53
|
-
ELSE
|
|
54
|
-
RAISE NOTICE 'organisationConfig: skipped backfill (column ai_assisted_interview_visible not found on "Organisation"—already migrated, empty DB, or non-matching search_path).';
|
|
55
|
-
END IF;
|
|
56
|
-
END $$;
|
|
1
|
+
-- CreateTable
|
|
2
|
+
CREATE TABLE IF NOT EXISTS "organisationConfig" (
|
|
3
|
+
"id" TEXT NOT NULL,
|
|
4
|
+
"organisation_id" TEXT NOT NULL,
|
|
5
|
+
"config_key" TEXT NOT NULL,
|
|
6
|
+
"value" JSONB NOT NULL,
|
|
7
|
+
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
8
|
+
"updated_at" TIMESTAMP(3) NOT NULL,
|
|
9
|
+
|
|
10
|
+
CONSTRAINT "organisationConfig_pkey" PRIMARY KEY ("id")
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
-- CreateIndex (idempotent for re-runs)
|
|
14
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "organisationConfig_organisation_id_config_key_key" ON "organisationConfig"("organisation_id", "config_key");
|
|
15
|
+
|
|
16
|
+
-- AddForeignKey (ignore if exists)
|
|
17
|
+
DO $$
|
|
18
|
+
BEGIN
|
|
19
|
+
IF NOT EXISTS (
|
|
20
|
+
SELECT 1 FROM pg_constraint WHERE conname = 'organisationConfig_organisation_id_fkey'
|
|
21
|
+
) THEN
|
|
22
|
+
ALTER TABLE "organisationConfig" ADD CONSTRAINT "organisationConfig_organisation_id_fkey" FOREIGN KEY ("organisation_id") REFERENCES "Organisation"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
23
|
+
END IF;
|
|
24
|
+
END $$;
|
|
25
|
+
|
|
26
|
+
-- Backfill from legacy column when present, then drop column.
|
|
27
|
+
-- IMPORTANT: Backfill runs only while `ai_assisted_interview_visible` still exists on
|
|
28
|
+
-- `"Organisation"`. If this migration applied once successfully, revoke + redeploy will
|
|
29
|
+
-- NOT re-insert—a column restore or manual INSERT is needed for replay scenarios.
|
|
30
|
+
DO $$
|
|
31
|
+
BEGIN
|
|
32
|
+
IF EXISTS (
|
|
33
|
+
SELECT 1
|
|
34
|
+
FROM pg_catalog.pg_attribute a
|
|
35
|
+
INNER JOIN pg_catalog.pg_class c ON c.oid = a.attrelid
|
|
36
|
+
INNER JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
|
|
37
|
+
WHERE n.nspname = ANY (current_schemas(true))
|
|
38
|
+
AND c.relkind = 'r'
|
|
39
|
+
AND c.relname = 'Organisation'
|
|
40
|
+
AND a.attname = 'ai_assisted_interview_visible'
|
|
41
|
+
AND a.attnum > 0
|
|
42
|
+
AND NOT a.attisdropped
|
|
43
|
+
) THEN
|
|
44
|
+
INSERT INTO "organisationConfig" ("id", "organisation_id", "config_key", "value", "created_at", "updated_at")
|
|
45
|
+
SELECT gen_random_uuid()::text, "id", 'ai_assisted_interview_visible', to_jsonb(false), CURRENT_TIMESTAMP, CURRENT_TIMESTAMP
|
|
46
|
+
FROM "Organisation"
|
|
47
|
+
WHERE "ai_assisted_interview_visible" IS FALSE
|
|
48
|
+
ON CONFLICT ("organisation_id", "config_key") DO NOTHING;
|
|
49
|
+
|
|
50
|
+
ALTER TABLE "Organisation" DROP COLUMN "ai_assisted_interview_visible";
|
|
51
|
+
|
|
52
|
+
RAISE NOTICE 'organisationConfig: backfilled from ai_assisted_interview_visible and dropped legacy column.';
|
|
53
|
+
ELSE
|
|
54
|
+
RAISE NOTICE 'organisationConfig: skipped backfill (column ai_assisted_interview_visible not found on "Organisation"—already migrated, empty DB, or non-matching search_path).';
|
|
55
|
+
END IF;
|
|
56
|
+
END $$;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
-- Remove duplicate (organisation_id, config_key) rows, keeping the newest by updated_at.
|
|
2
|
-
-- Safe to run multiple times; no-op when already unique.
|
|
3
|
-
DELETE FROM "organisationConfig" d
|
|
4
|
-
WHERE EXISTS (
|
|
5
|
-
SELECT 1
|
|
6
|
-
FROM (
|
|
7
|
-
SELECT
|
|
8
|
-
"id",
|
|
9
|
-
ROW_NUMBER() OVER (
|
|
10
|
-
PARTITION BY "organisation_id", "config_key"
|
|
11
|
-
ORDER BY "updated_at" DESC NULLS LAST, "id" DESC
|
|
12
|
-
) AS rn
|
|
13
|
-
FROM "organisationConfig"
|
|
14
|
-
) k
|
|
15
|
-
WHERE k."id" = d."id"
|
|
16
|
-
AND k.rn > 1
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
CREATE UNIQUE INDEX IF NOT EXISTS "organisationConfig_organisation_id_config_key_key"
|
|
20
|
-
ON "organisationConfig"("organisation_id", "config_key");
|
|
1
|
+
-- Remove duplicate (organisation_id, config_key) rows, keeping the newest by updated_at.
|
|
2
|
+
-- Safe to run multiple times; no-op when already unique.
|
|
3
|
+
DELETE FROM "organisationConfig" d
|
|
4
|
+
WHERE EXISTS (
|
|
5
|
+
SELECT 1
|
|
6
|
+
FROM (
|
|
7
|
+
SELECT
|
|
8
|
+
"id",
|
|
9
|
+
ROW_NUMBER() OVER (
|
|
10
|
+
PARTITION BY "organisation_id", "config_key"
|
|
11
|
+
ORDER BY "updated_at" DESC NULLS LAST, "id" DESC
|
|
12
|
+
) AS rn
|
|
13
|
+
FROM "organisationConfig"
|
|
14
|
+
) k
|
|
15
|
+
WHERE k."id" = d."id"
|
|
16
|
+
AND k.rn > 1
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "organisationConfig_organisation_id_config_key_key"
|
|
20
|
+
ON "organisationConfig"("organisation_id", "config_key");
|
package/prisma/schema/migrations/20260515120000_add_interview_ai_assistance_mode/migration.sql
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
-- CreateEnum
|
|
2
|
-
CREATE TYPE "AiAssistanceMode" AS ENUM ('NONE', 'ASSISTED');
|
|
3
|
-
|
|
4
|
-
-- AlterTable
|
|
5
|
-
ALTER TABLE "Interview" ADD COLUMN "ai_assistance_mode" "AiAssistanceMode" NOT NULL DEFAULT 'ASSISTED';
|
|
1
|
+
-- CreateEnum
|
|
2
|
+
CREATE TYPE "AiAssistanceMode" AS ENUM ('NONE', 'ASSISTED');
|
|
3
|
+
|
|
4
|
+
-- AlterTable
|
|
5
|
+
ALTER TABLE "Interview" ADD COLUMN "ai_assistance_mode" "AiAssistanceMode" NOT NULL DEFAULT 'ASSISTED';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
CREATE TYPE "EvaluationPlanShareScope" AS ENUM (
|
|
2
|
+
'PRIVATE',
|
|
3
|
+
'CREATOR',
|
|
4
|
+
'ORGANIZATION'
|
|
5
|
+
);
|
|
6
|
+
|
|
7
|
+
ALTER TABLE "EvaluationPlan"
|
|
8
|
+
ADD COLUMN "share_scope" "EvaluationPlanShareScope" NOT NULL DEFAULT 'PRIVATE';
|
|
9
|
+
|
|
10
|
+
CREATE INDEX "EvaluationPlan_job_description_id_plan_type_share_scope_idx"
|
|
11
|
+
ON "EvaluationPlan"("job_description_id", "plan_type", "share_scope");
|
|
12
|
+
|
|
13
|
+
CREATE INDEX "EvaluationPlan_created_by_share_scope_idx"
|
|
14
|
+
ON "EvaluationPlan"("created_by", "share_scope");
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# Please do not edit this file manually
|
|
2
|
-
# It should be added in your version-control system (i.e. Git)
|
|
3
|
-
provider = "postgresql"
|
|
1
|
+
# Please do not edit this file manually
|
|
2
|
+
# It should be added in your version-control system (i.e. Git)
|
|
3
|
+
provider = "postgresql"
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
model Notes {
|
|
2
|
-
id String @id @default(uuid())
|
|
3
|
-
application_id String
|
|
4
|
-
user_id String
|
|
5
|
-
note String
|
|
6
|
-
pinned Boolean @default(false)
|
|
7
|
-
created_at DateTime @default(now())
|
|
8
|
-
updated_at DateTime @updatedAt
|
|
9
|
-
created_by String
|
|
10
|
-
updated_by String
|
|
11
|
-
is_active Boolean @default(true)
|
|
12
|
-
|
|
13
|
-
// Relations
|
|
14
|
-
application Application @relation(fields: [application_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
15
|
-
user User @relation(fields: [user_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
16
|
-
|
|
17
|
-
@@index([application_id, created_at])
|
|
18
|
-
@@index([user_id, created_at])
|
|
19
|
-
}
|
|
1
|
+
model Notes {
|
|
2
|
+
id String @id @default(uuid())
|
|
3
|
+
application_id String
|
|
4
|
+
user_id String
|
|
5
|
+
note String
|
|
6
|
+
pinned Boolean @default(false)
|
|
7
|
+
created_at DateTime @default(now())
|
|
8
|
+
updated_at DateTime @updatedAt
|
|
9
|
+
created_by String
|
|
10
|
+
updated_by String
|
|
11
|
+
is_active Boolean @default(true)
|
|
12
|
+
|
|
13
|
+
// Relations
|
|
14
|
+
application Application @relation(fields: [application_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
15
|
+
user User @relation(fields: [user_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
16
|
+
|
|
17
|
+
@@index([application_id, created_at])
|
|
18
|
+
@@index([user_id, created_at])
|
|
19
|
+
}
|