I read that if I want to add a field to a table via Phoenix I can do so by opening the recent migration file and altering it with a field such as this:
alter table(:testbeds) do
add :url, :string
end
So I took my original migration that looked like this:
defmodule App.Repo.Migrations.CreateTestbeds do
use Ecto.Migration
def change do
create table(:testbeds) do
add :name, :string
add :version, :string
add :note, :string
add :developer, :string
add :status, :string
add :status_action_value, :string
timestamps()
end
end
end
and changed it to this:
defmodule App.Repo.Migrations.CreateTestbeds do
use Ecto.Migration
def change do
create table(:testbeds) do
add :name, :string
add :version, :string
add :note, :string
add :developer, :string
add :status, :string
add :status_action_value, :string
timestamps()
end
alter table(:testbeds) do
add :url, :string
end
end
end
I ran this command in the terminal:
mix ecto.migrate
A prompt said:
[info] Migrations already up
I opened up Postgres and queried the table, nothing has changed.