Yes, the migration is empty! Ecto doesn’t try to magically figure out the migration from the schema. That’s why the book explicitly asks why you fill this in:
defmodule Rumbl.Repo.Migrations.CreateUsers do
use Ecto.Migration
def change do
create table(:users) do
add :name, :string
add :username, :string, null: false
timestamps()
end
create unique_index(:users, [:username]) end
end
end
You can probably find the exact snippet in the book. ![]()


















