@adaptware/eagles-db 0.5.39 → 0.5.40

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": "@adaptware/eagles-db",
3
- "version": "0.5.39",
3
+ "version": "0.5.40",
4
4
  "description": "A Prisma client package for Treadspace database operations",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -12,29 +12,33 @@ enum JobApplicationFieldType {
12
12
 
13
13
  model JobApplicationField {
14
14
  /// Primary key (UUID)
15
- id String @id @default(uuid())
15
+ id String @id @default(uuid())
16
16
  /// Foreign keys
17
- organisation_id String
18
- template_id String
17
+ organisation_id String
18
+ template_id String
19
19
  /// Data fields
20
- field_type JobApplicationFieldType
21
- label String
22
- description String?
23
- is_mandatory Boolean @default(false)
24
- is_draft Boolean @default(true)
25
- options String[]
20
+ field_type JobApplicationFieldType
21
+ label String
22
+ description String?
23
+ is_mandatory Boolean @default(false)
24
+ is_draft Boolean @default(true)
25
+ options String[]
26
26
  /// Audit fields
27
- is_active Boolean @default(true)
28
- created_by String
29
- updated_by String
30
- created_at DateTime @default(now())
31
- updated_at DateTime @updatedAt
27
+ is_active Boolean @default(true)
28
+ created_by String
29
+ updated_by String
30
+ created_at DateTime @default(now())
31
+ updated_at DateTime @updatedAt
32
+
33
+ /// order of question
34
+ order_no Int? //nullable for now to allow migration
35
+
32
36
  /// Relations
33
37
  organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
34
38
  job_application_template JobApplicationTemplate @relation(fields: [template_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
35
39
  job_application_responses JobApplicationResponse[]
36
40
 
37
41
  /// Indexes
38
- @@index([organisation_id, template_id])
42
+ @@index([organisation_id, template_id, order_no])
39
43
  @@schema("public")
40
44
  }
@@ -22,13 +22,15 @@ model JobApplicationResponse {
22
22
  created_by String
23
23
  updated_by String
24
24
  is_active Boolean @default(true)
25
+ order_no Int? //nullable for now to allow migration
26
+
25
27
  /// Relations
26
- application Application @relation(fields: [application_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
27
- field JobApplicationField? @relation(fields: [job_application_field_id], references: [id], onDelete: Restrict, onUpdate: Cascade)
28
- document Document? @relation(fields: [document_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
28
+ application Application @relation(fields: [application_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
29
+ field JobApplicationField? @relation(fields: [job_application_field_id], references: [id], onDelete: Restrict, onUpdate: Cascade)
30
+ document Document? @relation(fields: [document_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
29
31
 
30
- /// Partial unique on (application_id, job_application_field_id) WHERE job_application_field_id IS NOT NULL — see migration SQL
31
- @@index([application_id])
32
+ // / Partial unique on (application_id, job_application_field_id) WHERE job_application_field_id IS NOT NULL — see migration SQL
33
+ @@index([application_id, is_active, order_no])
32
34
  @@index([job_application_field_id])
33
35
  @@schema("public")
34
36
  }