title: Unable to create new Postgres Table for Elixir's Phoenix
body: <p>I'm following <a href="https://robots.thoughtbot.com/testing-a-phoenix-elixir-json-api" rel="nofollow">https://robots.thoughtbot.com/testing-a-phoenix-elixir-json-api</a></p>
  
  <p>And I'm attempting to create a migration.</p>
  
  <p>When I run mix ecto.migrate I get:</p>
  
  <pre><code>/code/mpa:.mix ecto.migrate
  ** (exit) exited in: GenServer.call(#PID&lt;0.141.0&gt;, {:query, "CREATE TABLE IF NOT EXISTS \"schema_migrations\" (\"version\" bigint PRIMARY KEY, \"inserted_at\" timestamp)", []}, :infinity)
      ** (EXIT) %Postgrex.Error{message: nil, postgres: %{code: :invalid_catalog_name, file: "postinit.c", line: "794", message: "database \"mpa_dev\" does not exist", pg_code: "3D000", routine: "InitPostgres", severity: "FATAL"}}
      (elixir) lib/gen_server.ex:356: GenServer.call/3
      (postgrex) lib/postgrex/connection.ex:102: Postgrex.Connection.query/4
      (ecto) lib/ecto/adapters/postgres/connection.ex:31: Ecto.Adapters.Postgres.Connection.query/4
      (ecto) lib/ecto/adapters/sql.ex:228: Ecto.Adapters.SQL.query/7
      (ecto) lib/ecto/pool.ex:159: Ecto.Pool.do_run/4
      (ecto) lib/ecto/adapters/sql.ex:216: Ecto.Adapters.SQL.query/6
      (ecto) lib/ecto/adapters/sql.ex:191: Ecto.Adapters.SQL.query/5
      (elixir) lib/enum.ex:1261: Enum."-reduce/3-lists^foldl/2-0-"/3
  </code></pre>
  
  <p>but I just created the table. Checking in Postgres:</p>
  
  <pre><code>~:.psql -d template1
  psql (9.4.4)
  Type "help" for help.
  
  template1=# CREATE TABLE mpa_dev();
  ERROR:  relation "mpa_dev" already exists
  template1=#
  </code></pre>
  
  <p>why am I getting this error &amp; how can I create the table?</p>