@axinom/mosaic-db-common 0.63.0-rc.9 → 0.63.0

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.
@@ -1144,11 +1144,22 @@ BEGIN
1144
1144
  LOOP
1145
1145
  -- 2. Delete all table event metadata and row log entries associated with the transaction.
1146
1146
  PERFORM pgmemento.delete_table_event_log(transaction_id, tablename, schemaname);
1147
- -- 3. Delete the transaction metadata itself.
1148
- PERFORM pgmemento.delete_txid_log(transaction_id);
1149
1147
  counter := counter + 1;
1150
1148
  END LOOP;
1151
1149
 
1150
+ -- 3. Delete the transaction metadata itself, only after all of its table events are gone.
1151
+ -- Deleting it earlier cascades to the remaining table events and orphans their row log entries.
1152
+ FOR transaction_id IN (
1153
+ SELECT
1154
+ tl.id
1155
+ FROM
1156
+ pgmemento.transaction_log tl
1157
+ WHERE
1158
+ tl.txid_time < NOW() - age)
1159
+ LOOP
1160
+ PERFORM pgmemento.delete_txid_log(transaction_id);
1161
+ END LOOP;
1162
+
1152
1163
  RETURN counter;
1153
1164
  END;
1154
1165
  $$;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axinom/mosaic-db-common",
3
- "version": "0.63.0-rc.9",
3
+ "version": "0.63.0",
4
4
  "engines": {
5
5
  "node": ">=20.19.0"
6
6
  },
@@ -71,7 +71,7 @@
71
71
  "zapatos": "3.6.0"
72
72
  },
73
73
  "devDependencies": {
74
- "@axinom/mosaic-dev-be-common": "^0.25.0-rc.9",
74
+ "@axinom/mosaic-dev-be-common": "^0.25.0",
75
75
  "@types/express": "^4.17.17",
76
76
  "@types/node": "^22.0.0",
77
77
  "@types/pg": "^8.6.1",
@@ -84,5 +84,5 @@
84
84
  "publishConfig": {
85
85
  "access": "public"
86
86
  },
87
- "gitHead": "4ce8052ce288d7facf56061549fd4882390a101f"
87
+ "gitHead": "435be295e4c3bb53fb78f9964e55cc07148afd02"
88
88
  }