@proteinjs/db 1.46.0 → 1.46.1

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.46.1](https://github.com/proteinjs/db/compare/@proteinjs/db@1.46.0...@proteinjs/db@1.46.1) (2026-09-12)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **db:** the migration ledger's record table orders by created, newest first ([9fde88a](https://github.com/proteinjs/db/commit/9fde88a1cbd6423af50b3ea125134c8e88f0d2bb))
12
+
13
+
14
+
15
+
16
+
6
17
  # [1.46.0](https://github.com/proteinjs/db/compare/@proteinjs/db@1.45.0...@proteinjs/db@1.46.0) (2026-09-03)
7
18
 
8
19
 
@@ -73,13 +73,19 @@ export declare class MigrationTable extends Table<Migration> {
73
73
  */
74
74
  auth: Table<Migration>['auth'];
75
75
  /**
76
- * The row scan the founder actually reads (ruled 2026-09-02): WHICH migration (name — the
77
- * loader's class name), what it does, how the run went, WHEN it ran ("Ran at" = start_time,
78
- * the one timestamp that answers "when did it land"), how long, when it finished, and a
79
- * glimpse of its output (the mono JSON snippet; the record form carries the full value).
80
- * The declaration flags and the failure detail stay on the record form. Most recent run
81
- * first; never-run rows last — GoogleSQL orders NULL as the least value, so start_time DESC
82
- * places rows without a run after every real timestamp; ledger order (created) breaks ties.
76
+ * The row scan: WHICH migration (name — the loader's class name), what it does, how the run
77
+ * went, WHEN it ran ("Ran at" = start_time, the one timestamp that answers "when did it
78
+ * land"), how long, when it finished, and a glimpse of its output (the mono JSON snippet; the
79
+ * record form carries the full value). The declaration flags and the failure detail stay on
80
+ * the record form.
81
+ *
82
+ * Ordered as a ledger: newest first by `created` (id breaking ties — rows land in batches at
83
+ * one boot), the reverse of the order {@link MigrationRunner.runPendingMigrations} runs them
84
+ * in. Status plays no part: a row that never ran (`proposed`, a `manual` migration waiting
85
+ * for its operator) keeps its place among the rows that did, so the migrations that shipped
86
+ * together read together. An order by run time would push every never-run row below every
87
+ * run one (a never-run row has no start_time, and GoogleSQL orders NULL as the least value,
88
+ * last under DESC) — the pending manual migrations become the hardest rows to find.
83
89
  */
84
90
  ui: Table<Migration>['ui'];
85
91
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"MigrationTable.d.ts","sourceRoot":"","sources":["../../../src/tables/MigrationTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,YAAY,EAA2B,MAAM,wBAAwB,CAAC;AAE/E,MAAM,WAAW,SAAU,SAAQ,YAAY;IAC7C;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;IACxD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,GAAG,EAAE,MAAM,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;CAChC;AAED,qBAAa,cAAe,SAAQ,KAAK,CAAC,SAAS,CAAC;IAC3C,IAAI,SAAe;IAC1B;;;;;;;;OAQG;IACI,IA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AAI,SAAe;IAC1B;;;;;;;;OAQG;IACI,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAGnC;IACF;;;;;;;;;;;;;;OAcG;IACI,EAAE,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAQ/B;IACF;;;;;OAKG;IACI,OAAO;;;;;;;;;;;;;;;;;;;;;;MAeX;IACI,mBAAmB,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,qBAAqB,CAAC,CASjE;CACH"}
@@ -74,20 +74,26 @@ var MigrationTable = /** @class */ (function (_super) {
74
74
  service: { query: { permission: 'dev' }, update: { permission: 'dev' }, delete: { permission: 'dev' } },
75
75
  };
76
76
  /**
77
- * The row scan the founder actually reads (ruled 2026-09-02): WHICH migration (name — the
78
- * loader's class name), what it does, how the run went, WHEN it ran ("Ran at" = start_time,
79
- * the one timestamp that answers "when did it land"), how long, when it finished, and a
80
- * glimpse of its output (the mono JSON snippet; the record form carries the full value).
81
- * The declaration flags and the failure detail stay on the record form. Most recent run
82
- * first; never-run rows last — GoogleSQL orders NULL as the least value, so start_time DESC
83
- * places rows without a run after every real timestamp; ledger order (created) breaks ties.
77
+ * The row scan: WHICH migration (name — the loader's class name), what it does, how the run
78
+ * went, WHEN it ran ("Ran at" = start_time, the one timestamp that answers "when did it
79
+ * land"), how long, when it finished, and a glimpse of its output (the mono JSON snippet; the
80
+ * record form carries the full value). The declaration flags and the failure detail stay on
81
+ * the record form.
82
+ *
83
+ * Ordered as a ledger: newest first by `created` (id breaking ties — rows land in batches at
84
+ * one boot), the reverse of the order {@link MigrationRunner.runPendingMigrations} runs them
85
+ * in. Status plays no part: a row that never ran (`proposed`, a `manual` migration waiting
86
+ * for its operator) keeps its place among the rows that did, so the migrations that shipped
87
+ * together read together. An order by run time would push every never-run row below every
88
+ * run one (a never-run row has no start_time, and GoogleSQL orders NULL as the least value,
89
+ * last under DESC) — the pending manual migrations become the hardest rows to find.
84
90
  */
85
91
  _this.ui = {
86
92
  recordTable: {
87
93
  columns: ['name', 'description', 'status', 'startTime', 'duration', 'endTime', 'output'],
88
94
  sort: [
89
- { field: 'startTime', desc: true },
90
- { field: 'created', desc: false },
95
+ { field: 'created', desc: true },
96
+ { field: 'id', desc: true },
91
97
  ],
92
98
  },
93
99
  };
@@ -1 +1 @@
1
- {"version":3,"file":"MigrationTable.js","sourceRoot":"","sources":["../../../src/tables/MigrationTable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,sCAAuF;AACvF,kCAAiC;AACjC,uDAA+E;AA8D/E;IAAoC,kCAAgB;IAApD;QAAA,qEAiEC;QAhEQ,UAAI,GAAG,WAAW,CAAC;QAC1B;;;;;;;;WAQG;QACI,UAAI,GAA6B;YACtC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE;YAClG,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE;SACxG,CAAC;QACF;;;;;;;;WAQG;QACI,QAAE,GAA2B;YAClC,WAAW,EAAE;gBACX,OAAO,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,CAAC;gBACxF,IAAI,EAAE;oBACJ,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE;oBAClC,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE;iBAClC;aACF;SACF,CAAC;QACF;;;;;WAKG;QACI,aAAO,GAAG,IAAA,sCA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AAE,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,CAAC;YACpE,OAAO,EAAE,IAAI,wBAAc,CAAC,UAAU,EAAE,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,CAAC;YACrE,0FAA0F;YAC1F,wEAAwE;YACxE,MAAM,EAAE,IAAI,sBAAY,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,CAAC;YAC/E,cAAc,EAAE,IAAI,sBAAY,CAAC,iBAAiB,EAAE,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,CAAC;YACvF,YAAY,EAAE,IAAI,sBAAY,CAAC,eAAe,EAAE,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,CAAC;SACrF,CAAC,CAAC;QACI,yBAAmB,GAA4C;YACpE,yFAAyF;YACzF,eAAe,EAAE,MAAM;YACvB,0FAA0F;YAC1F,qFAAqF;YACrF,eAAe,EAAE,UAAC,EAAQ;oBAAN,IAAI,UAAA;gBAAO,OAAA,CAAC,EAAE,IAAI,MAAA,EAAE,CAAC;YAAV,CAAU;YACzC,EAAE,EAAE;gBACF,WAAW,EAAE,IAAI;aAClB;SACF,CAAC;;IACJ,CAAC;IAAD,qBAAC;AAAD,CAAC,AAvED,CAAoC,aAAK,GAuExC;AAvEY,wCAAc"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proteinjs/db",
3
- "version": "1.46.0",
3
+ "version": "1.46.1",
4
4
  "main": "./dist/generated/index.js",
5
5
  "types": "./dist/generated/index.d.ts",
6
6
  "exports": {
@@ -66,5 +66,5 @@
66
66
  "ts-jest": "29.1.1",
67
67
  "typescript": "5.2.2"
68
68
  },
69
- "gitHead": "93bcd1aaf8d85abf75c20478e324b6b5323baf2f"
69
+ "gitHead": "4b682624f85debf1243334024833744a0ef0d3f2"
70
70
  }
@@ -79,20 +79,26 @@ export class MigrationTable extends Table<Migration> {
79
79
  service: { query: { permission: 'dev' }, update: { permission: 'dev' }, delete: { permission: 'dev' } },
80
80
  };
81
81
  /**
82
- * The row scan the founder actually reads (ruled 2026-09-02): WHICH migration (name — the
83
- * loader's class name), what it does, how the run went, WHEN it ran ("Ran at" = start_time,
84
- * the one timestamp that answers "when did it land"), how long, when it finished, and a
85
- * glimpse of its output (the mono JSON snippet; the record form carries the full value).
86
- * The declaration flags and the failure detail stay on the record form. Most recent run
87
- * first; never-run rows last — GoogleSQL orders NULL as the least value, so start_time DESC
88
- * places rows without a run after every real timestamp; ledger order (created) breaks ties.
82
+ * The row scan: WHICH migration (name — the loader's class name), what it does, how the run
83
+ * went, WHEN it ran ("Ran at" = start_time, the one timestamp that answers "when did it
84
+ * land"), how long, when it finished, and a glimpse of its output (the mono JSON snippet; the
85
+ * record form carries the full value). The declaration flags and the failure detail stay on
86
+ * the record form.
87
+ *
88
+ * Ordered as a ledger: newest first by `created` (id breaking ties — rows land in batches at
89
+ * one boot), the reverse of the order {@link MigrationRunner.runPendingMigrations} runs them
90
+ * in. Status plays no part: a row that never ran (`proposed`, a `manual` migration waiting
91
+ * for its operator) keeps its place among the rows that did, so the migrations that shipped
92
+ * together read together. An order by run time would push every never-run row below every
93
+ * run one (a never-run row has no start_time, and GoogleSQL orders NULL as the least value,
94
+ * last under DESC) — the pending manual migrations become the hardest rows to find.
89
95
  */
90
96
  public ui: Table<Migration>['ui'] = {
91
97
  recordTable: {
92
98
  columns: ['name', 'description', 'status', 'startTime', 'duration', 'endTime', 'output'],
93
99
  sort: [
94
- { field: 'startTime', desc: true },
95
- { field: 'created', desc: false },
100
+ { field: 'created', desc: true },
101
+ { field: 'id', desc: true },
96
102
  ],
97
103
  },
98
104
  };