@sixb/pg 0.1.2 → 0.1.3

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.
@@ -25,6 +25,7 @@ export class PgMaterializationWriter {
25
25
  objectTypeId: item.ref.objectTypeId,
26
26
  primaryId: item.ref.primaryId,
27
27
  value: item.value,
28
+ editedAt: item.editedAt,
28
29
  lastCommitId: item.lastCommitId,
29
30
  updatedAt: item.updatedAt,
30
31
  expectedLastCommitId: item.expectedLastCommitId,
@@ -36,10 +37,10 @@ export class PgMaterializationWriter {
36
37
  SELECT value FROM jsonb_array_elements(${jsonParameter(this.sql, objectInserts)}::jsonb)
37
38
  )
38
39
  INSERT INTO ontology_object_overrides (
39
- project_id, object_type_id, primary_id, value, last_commit_id, updated_at
40
+ project_id, object_type_id, primary_id, value, edited_at, last_commit_id, updated_at
40
41
  )
41
42
  SELECT ${projectId}, value->>'objectTypeId', value->>'primaryId', value->'value',
42
- value->>'lastCommitId',
43
+ value->'editedAt', value->>'lastCommitId',
43
44
  (value->>'updatedAt')::timestamptz
44
45
  FROM staged
45
46
  ON CONFLICT DO NOTHING
@@ -55,7 +56,8 @@ export class PgMaterializationWriter {
55
56
  SELECT value FROM jsonb_array_elements(${jsonParameter(this.sql, objectUpdates)}::jsonb)
56
57
  )
57
58
  UPDATE ontology_object_overrides AS overrides
58
- SET value = staged.value->'value', last_commit_id = staged.value->>'lastCommitId',
59
+ SET value = staged.value->'value', edited_at = staged.value->'editedAt',
60
+ last_commit_id = staged.value->>'lastCommitId',
59
61
  updated_at = (staged.value->>'updatedAt')::timestamptz
60
62
  FROM staged
61
63
  WHERE overrides.project_id = ${projectId}