Skip to content

Instantly share code, notes, and snippets.

@dwilkie
Last active July 21, 2018 03:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dwilkie/4d9a7a4dd5e4fad6110ac61cac4ce6d8 to your computer and use it in GitHub Desktop.
Save dwilkie/4d9a7a4dd5e4fad6110ac61cac4ce6d8 to your computer and use it in GitHub Desktop.
p SensorEvent.where("payload->>'created_at' = '0000-00-00 00:00:00 UTC+7'").delete_all
p SensorEvent.where("payload->'created_at' is not null").update_all("created_at = (payload->>'created_at')::timestamp without time zone")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment