Added timestamps to tweets and they organize by newest on top

This commit is contained in:
2026-04-01 11:58:12 -04:00
parent ae35600822
commit 0ac0b68029
5 changed files with 193 additions and 7 deletions

View File

@@ -0,0 +1,28 @@
defmodule Mixer.Repo.Migrations.AddTimestampsToTweets do
@moduledoc """
Updates resources based on their most recent snapshots.
This file was autogenerated with `mix ash_postgres.generate_migrations`
"""
use Ecto.Migration
def up do
alter table(:tweets) do
add :inserted_at, :utc_datetime_usec,
null: false,
default: fragment("(now() AT TIME ZONE 'utc')")
add :updated_at, :utc_datetime_usec,
null: false,
default: fragment("(now() AT TIME ZONE 'utc')")
end
end
def down do
alter table(:tweets) do
remove :updated_at
remove :inserted_at
end
end
end