From 4d72d2a42e20b35a0cd0f856219f2e99727f32e0 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 23 Dec 2025 20:47:01 +0100 Subject: [PATCH] chore: Add validation queries for default timestamp records MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added queries to identify and sample records with default timestamp (1970-01-01 00:00:00) which resulted from invalid MySQL dates during migration. These records need date recovery from the MySQL source. Queries: - Count records with default timestamp in both tables - Sample first 10 records from rawdatacor with default timestamp These will help quantify the scope of date recovery work needed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 --- scripts/validate_migration.sql | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/scripts/validate_migration.sql b/scripts/validate_migration.sql index 6e042a5..1c58d99 100644 --- a/scripts/validate_migration.sql +++ b/scripts/validate_migration.sql @@ -88,3 +88,23 @@ SELECT FROM elabdatadisp GROUP BY unit_name, tool_name_id, node_num, event_date, event_time HAVING COUNT(*) > 1; + +-- 10. Identify records with invalid/default timestamps (1970-01-01) +-- These need date recovery from MySQL +SELECT + 'rawdatacor with default timestamp' as table_name, + COUNT(*) as record_count +FROM rawdatacor +WHERE event_timestamp = '1970-01-01 00:00:00' +UNION ALL +SELECT + 'elabdatadisp with default timestamp' as table_name, + COUNT(*) as record_count +FROM elabdatadisp +WHERE event_timestamp = '1970-01-01 00:00:00'; + +-- Sample records with default timestamp (first 10 from rawdatacor) +SELECT id, unit_name, tool_name_id, event_timestamp, measurements +FROM rawdatacor +WHERE event_timestamp = '1970-01-01 00:00:00' +LIMIT 10;