-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add upgrade 0.35 command module #9175
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR reorganizes database upgrade commands by moving several data structure modifications from version 0.40 to 0.35, creating a clearer separation between schema changes and data migration.
- Critical bug: Incorrect version number in logging message in
0-35-upgrade-version.command.ts
references version 0.40 instead of 0.35 - Redundant TypeOrmModule registration for FieldMetadataEntity in
0-40-upgrade-version.module.ts
- Missing error handling in sequential command execution in
0-35-upgrade-version.command.ts
could leave database in inconsistent state - Clearer upgrade path: schema changes in 0.35 (columns, positions) followed by data migration in 0.40
8 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings | Greptile
this.logger.log( | ||
'Running command to upgrade to 0.40: must start with phone calling code otherwise SyncMetadata will fail', | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: Log message incorrectly references version 0.40 instead of 0.35
this.logger.log( | |
'Running command to upgrade to 0.40: must start with phone calling code otherwise SyncMetadata will fail', | |
); | |
this.logger.log( | |
'Running command to upgrade to 0.35: must start with phone calling code otherwise SyncMetadata will fail', | |
); |
'Running command to upgrade to 0.40: must start with phone calling code otherwise SyncMetadata will fail', | ||
); | ||
|
||
await this.recordPositionBackfillCommand.executeActiveWorkspacesCommand( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: No error handling around sequential commands. If one fails, database could be left in inconsistent state. Consider wrapping in try/catch with rollback capability.
[ObjectMetadataEntity, FieldMetadataEntity], | ||
'metadata', | ||
), | ||
TypeOrmModule.forFeature([FieldMetadataEntity], 'metadata'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: FieldMetadataEntity is imported twice in TypeOrmModule.forFeature(). Remove the duplicate import on line 27.
await this.phoneCallingCodeMigrateDataCommand.executeActiveWorkspacesCommand( | ||
passedParam, | ||
options, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: log message still references 0.40 but some commands were moved to 0.35
Moving commands from 0.40 to 0.35 since they should be ready for 0.35.