1 Commits

Author SHA1 Message Date
Sebastian Seedorf
103432820a fix: add migration to change green/red/threshold from INTEGER to BIGINT 2026-06-05 13:03:12 +02:00
2 changed files with 14 additions and 2 deletions

View File

@@ -57,11 +57,11 @@ export function usePlot(
// Defer mouseleave — prevents React hydration events firing before lastIdxRef set // Defer mouseleave — prevents React hydration events firing before lastIdxRef set
requestAnimationFrame(() => { requestAnimationFrame(() => {
plot.over.onmouseleave = () => { plot.over.addEventListener('mouseleave', () => {
const p = plotRef.current; const p = plotRef.current;
if (!p) return; if (!p) return;
p.setCursor({ left: idxToPixel(p, lastIdxRef.current), top: -10 }); p.setCursor({ left: idxToPixel(p, lastIdxRef.current), top: -10 });
}; });
}); });
} }
// deps is intentionally dynamic — passed by parent to allow external rebuild triggers // deps is intentionally dynamic — passed by parent to allow external rebuild triggers

View File

@@ -0,0 +1,12 @@
/** @type {import('node-pg-migrate').MigrationBuilder} */
exports.up = (pgm) => {
pgm.sql(`ALTER TABLE signals ALTER COLUMN green TYPE bigint`);
pgm.sql(`ALTER TABLE signals ALTER COLUMN red TYPE bigint`);
pgm.sql(`ALTER TABLE alerts ALTER COLUMN threshold TYPE bigint`);
};
exports.down = (pgm) => {
pgm.sql(`ALTER TABLE alerts ALTER COLUMN threshold TYPE integer`);
pgm.sql(`ALTER TABLE signals ALTER COLUMN red TYPE integer`);
pgm.sql(`ALTER TABLE signals ALTER COLUMN green TYPE integer`);
};