0
inserted_atレコードを選択:エクト:私は非常に単純な<a href="http://www.phoenixframework.org/docs/ecto-models" rel="nofollow noreferrer">Ecto model</a>を持っている特定の日付
defmodule MyApp.User do
use MyApp.Web, :model
schema "users" do
field :name, :string
timestamps()
end
@doc """
Builds a changeset based on the `struct` and `params`.
"""
def changeset(struct, params \\ %{}) do
struct
|> cast(params, [])
|> validate_required([])
end
end
と移行:
defmodule MyApp.Repo.Migrations.CreateUser do
use Ecto.Migration
def down do
drop table(:users)
end
def change do
drop_if_exists table(:users)
create table(:users) do
add :name, :string
timestamps()
end
end
end
私はinserted_at
特定の日付(のためだったすべての人users
を選択したいです今日、例)。それをする最善の方法は何ですか?