add warning message during data transfer

This commit is contained in:
Francis Cao 2023-01-04 00:26:31 -08:00
parent c24f8cb985
commit 3cf0617366
2 changed files with 6 additions and 3 deletions

View File

@ -56,7 +56,7 @@ SELECT gen_random_uuid() event_id,
1 event_type 1 event_type
FROM v1_pageview p FROM v1_pageview p
JOIN v1_session s JOIN v1_session s
ON s.session_id = s.session_id ON s.session_id = p.session_id
JOIN v1_website w JOIN v1_website w
ON w.website_id = s.website_id; ON w.website_id = s.website_id;
@ -68,12 +68,12 @@ SELECT e.event_uuid,
s.session_uuid, s.session_uuid,
e.created_at, e.created_at,
e.url, e.url,
1 event_type, 2 event_type,
e.event_name, e.event_name,
ed.event_data ed.event_data
FROM v1_event e FROM v1_event e
JOIN v1_session s JOIN v1_session s
ON s.session_id = s.session_id ON s.session_id = e.session_id
JOIN v1_website w JOIN v1_website w
ON w.website_id = s.website_id ON w.website_id = s.website_id
LEFT JOIN v1_event_data ed LEFT JOIN v1_event_data ed

View File

@ -63,6 +63,9 @@ async function checkV2Tables() {
await runSqlFile('../prisma/migrations/01_init/migration.sql'); await runSqlFile('../prisma/migrations/01_init/migration.sql');
console.log(execSync('prisma migrate resolve --applied 01_init').toString()); console.log(execSync('prisma migrate resolve --applied 01_init').toString());
console.log(execSync('prisma migrate deploy').toString()); console.log(execSync('prisma migrate deploy').toString());
console.log(
'Starting v2 data migration. Please do no cancel this process, it may take a while.',
);
await runSqlFile('../db/postgresql/migration_v2.sql'); await runSqlFile('../db/postgresql/migration_v2.sql');
} }
} }