Fix ScrobbleRule timestamps to use utc_datetime

This commit is contained in:
Claudio Ortolina
2026-03-06 09:58:40 +00:00
parent 54f19cd9a2
commit d3ae3a7381
2 changed files with 18 additions and 3 deletions
@@ -0,0 +1,15 @@
defmodule MusicLibrary.Repo.Migrations.FixScrobbleRulesTimestamps do
use Ecto.Migration
def up do
execute "UPDATE scrobble_rules SET inserted_at = inserted_at || 'Z' WHERE inserted_at NOT LIKE '%Z'"
execute "UPDATE scrobble_rules SET updated_at = updated_at || 'Z' WHERE updated_at NOT LIKE '%Z'"
end
def down do
execute "UPDATE scrobble_rules SET inserted_at = REPLACE(inserted_at, 'Z', '') WHERE inserted_at LIKE '%Z'"
execute "UPDATE scrobble_rules SET updated_at = REPLACE(updated_at, 'Z', '') WHERE updated_at LIKE '%Z'"
end
end