jenot/priv/repo/migrations/20241124160809_add_default_account.exs
2024-11-24 17:17:03 +01:00

16 lines
354 B
Elixir

defmodule Jenot.Repo.Migrations.AddDefaultAccount do
use Ecto.Migration
def change do
id = Ecto.UUID.generate()
now = DateTime.utc_now() |> DateTime.to_iso8601()
execute """
INSERT INTO accounts (id, inserted_at, updated_at)
VALUES ('#{id}', '#{now}', '#{now}')
""",
"""
DELETE FROM accounts
"""
end
end