@hirelink/database-prisma 1.1.5 → 1.1.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hirelink/database-prisma",
3
- "version": "1.1.5",
3
+ "version": "1.1.9",
4
4
  "description": "A Prisma-based database package for Hirelink applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,19 @@
1
+ -- AlterTable
2
+ ALTER TABLE "User" ALTER COLUMN "work_experience" SET DEFAULT 'experience';
3
+
4
+ -- CreateTable
5
+ CREATE TABLE "ExperienceHistory" (
6
+ "id" TEXT NOT NULL,
7
+ "status" "Work_experience" NOT NULL,
8
+ "employer" TEXT NOT NULL,
9
+ "start_date" TIMESTAMP(3) NOT NULL,
10
+ "end_date" TIMESTAMP(3) NOT NULL,
11
+ "userId" TEXT NOT NULL,
12
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
13
+ "updated_at" TIMESTAMP(3) NOT NULL,
14
+
15
+ CONSTRAINT "ExperienceHistory_pkey" PRIMARY KEY ("id")
16
+ );
17
+
18
+ -- AddForeignKey
19
+ ALTER TABLE "ExperienceHistory" ADD CONSTRAINT "ExperienceHistory_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
@@ -0,0 +1,12 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - The `status` column on the `CandidateDocument` table would be dropped and recreated. This will lead to data loss if there is data in the column.
5
+
6
+ */
7
+ -- CreateEnum
8
+ CREATE TYPE "CandidateDocumentStatus" AS ENUM ('pending', 'open', 'overdue', 'complete');
9
+
10
+ -- AlterTable
11
+ ALTER TABLE "CandidateDocument" DROP COLUMN "status",
12
+ ADD COLUMN "status" "CandidateDocumentStatus" NOT NULL DEFAULT 'pending';
@@ -16,7 +16,7 @@ model User {
16
16
  status UserStatus @default(active)
17
17
  created_at DateTime? @default(now())
18
18
  updated_at DateTime? @updatedAt
19
- work_experience Work_experience?
19
+ work_experience Work_experience? @default(experience)
20
20
  candidate_documents CandidateDocument[]
21
21
  hirelink_ids HirelinkId[]
22
22
  hr_users HrUser[]
@@ -27,6 +27,19 @@ model User {
27
27
  password_reset_requests PasswordResetRequest[]
28
28
  sessions Session[]
29
29
  verification_requests VerificationRequest[]
30
+ Experience_history ExperienceHistory[]
31
+ }
32
+
33
+ model ExperienceHistory {
34
+ id String @id @default(cuid())
35
+ status Work_experience
36
+ employer String
37
+ start_date DateTime
38
+ end_date DateTime
39
+ user User @relation(fields: [userId], references: [id])
40
+ userId String
41
+ created_at DateTime @default(now())
42
+ updated_at DateTime @updatedAt
30
43
  }
31
44
 
32
45
  model Organization {
@@ -99,16 +112,16 @@ model PolicyMaster {
99
112
  }
100
113
 
101
114
  model CandidateDocument {
102
- doc_id String @id
115
+ doc_id String @id
103
116
  doc_name String
104
117
  doc_type String
105
- status String
106
118
  uploaded_at String
107
119
  user_id String
108
120
  candidate_document_type CandidateDocumentType?
109
- created_at DateTime? @default(now())
110
- updated_at DateTime? @updatedAt
111
- user User @relation(fields: [user_id], references: [id])
121
+ status CandidateDocumentStatus @default(pending)
122
+ created_at DateTime? @default(now())
123
+ updated_at DateTime? @updatedAt
124
+ user User @relation(fields: [user_id], references: [id])
112
125
  }
113
126
 
114
127
  model Session {
@@ -233,3 +246,10 @@ enum NotificationStatus {
233
246
  Unread
234
247
  Read
235
248
  }
249
+
250
+ enum CandidateDocumentStatus {
251
+ pending
252
+ open
253
+ overdue
254
+ complete
255
+ }