Added timestamps to tweets and they organize by newest on top
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user