-
Notifications
You must be signed in to change notification settings - Fork 1
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
Dx create ep info updated messages #55
base: dx-topic-replay
Are you sure you want to change the base?
Conversation
|
||
public function handle() | ||
{ | ||
$this->backupStreamMessages(); |
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.
To be as paranoid as possible, should probably have try/catch around backing up of messages-- if this fails we wouldn't be able to restore, so shouldn't go any further.
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.
It occurred to me that if line 17 errors out, the following lines will not run, but in the spirit of your paranoia, I've added a check that the backup table has the same number of records as the original and throws an exception if they're not equal.
I've also wrapped the backup and check in a try/catch block to explicitly handle the case that the backup fails.
e404657
to
1cd3657
Compare
598fc13
to
b6fecf0
Compare
1cd3657
to
a49e84e
Compare
a49e84e
to
8e08951
Compare
public function handle() | ||
{ | ||
// Delete errant member_retired for Aurora Pujol on group Peroxisomal Disorders VCEP | ||
StreamMessage::find(4034)->delete(); |
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.
We will have to have a better way of identifying these records for deletion beside the id... because of the prior migration/reindexing, these messages will have moved to a different id (at least they appear to have done so in my test environment). Maybe they could at least be identified by timestamp?
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.
What if we run this in a migration before reindexing? In fact, we could run it before we do anything else to be sure.
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.
Lookup for these messages is now based on attributes of the message rather than the id.
…gs easier for cspec
Add actions to generate missing
ep_info_updated
dx messages and reorder/reindex stream message bycreated_at
.I opted to run these operations as two separate migrations so that one can fail (though that's not expected) without effecting the other.