-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Added command to fix bulk checkin action log entries #16500
base: develop
Are you sure you want to change the base?
Conversation
PR Summary
|
Background
A recent PR, #16489, fixed an issue where
action_logs.created_by
was being recorded as null andaction_logs.created_at
was being recorded incorrectly when bulk checking in accessories (other bulk checkin entries recorded correctly).This PR
This PR adds a command,
snipeit:fix-bulk-accessory-action-log-entries
, to fix bothcreated_at
andcreated_by
for the entries mentioned above.created_at
was being recorded as~1970-01-01 00:00:01
and sinceupdated_at
was recorded correctly, we can usecreated_at
being in1970
as a way to updatecreated_at
to theupdated_at
timestamp.created_by
is a little more tricky. Since other bulk checkins were being recorded correctly, this command looks to find theuser_id
by using each action log entry that has the 1970s issue mentioned above to find a matching log entry that hascreated_by
populated. Put another way, if a user did a bulk checkin including accessories, wherecreated_at
andcreated_by
would be incorrect, and the checkin also included checkins for assets, licenses, etc, we can use those entries to populatecreated_by
.Example output from a dry-run: