Migrate from record node UUID to internal ID#119
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request implements a significant database schema change to migrate the node table from using UUID-based identification to internal integer IDs (i_id) scoped within each record. The migration adds new columns i_id and p_i_id to the node table, transforms existing data, updates the activity_log entries to use the new ID scheme, recreates the activity_log_user_aggregate view, and changes the primary key from uuid to a composite key of (record_uuid, i_id).
Changes:
- Add i_id (internal ID) and p_i_id (parent internal ID) columns to the node table
- Migrate meta.h UUID arrays to i_id arrays and update activity_log content structure
- Replace the node table's primary key from uuid to composite (record_uuid, i_id)
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| src/db/dbMigrator/migration/survey/migrations/sqls/20260217085512-alter-table-node-add-iid-up.sql | Core migration logic that adds new columns, populates data, updates activity_log, recreates views, and changes primary key |
| src/db/dbMigrator/migration/survey/migrations/sqls/20260217085512-alter-table-node-add-iid-down.sql | Down migration file (currently empty with placeholder) |
| src/db/dbMigrator/migration/survey/migrations/20260217085512-alter-table-node-add-iid.js | JavaScript migration wrapper that loads and executes SQL files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...b/dbMigrator/migration/survey/migrations/sqls/20260217085512-alter-table-node-add-iid-up.sql
Outdated
Show resolved
Hide resolved
...b/dbMigrator/migration/survey/migrations/sqls/20260217085512-alter-table-node-add-iid-up.sql
Outdated
Show resolved
Hide resolved
...b/dbMigrator/migration/survey/migrations/sqls/20260217085512-alter-table-node-add-iid-up.sql
Outdated
Show resolved
Hide resolved
...b/dbMigrator/migration/survey/migrations/sqls/20260217085512-alter-table-node-add-iid-up.sql
Outdated
Show resolved
Hide resolved
...b/dbMigrator/migration/survey/migrations/sqls/20260217085512-alter-table-node-add-iid-up.sql
Outdated
Show resolved
Hide resolved
...dbMigrator/migration/survey/migrations/sqls/20260217085512-alter-table-node-add-iid-down.sql
Show resolved
Hide resolved
...b/dbMigrator/migration/survey/migrations/sqls/20260217085512-alter-table-node-add-iid-up.sql
Show resolved
Hide resolved
|



No description provided.