Creating a table in a Schema

Running the migration below is not creating the accounts table in the users schema.

  1. creates a user schema
  2. creates the accounts table in the default schema.

What am I doing wrong ?

defmodule FishingSpot.Repo.Migrations.AddAccountsTable do
  use Ecto.Migration

  def change do
    execute "CREATE SCHEMA users"

    create table(:accounts, prefix: :users) do
      add :identifier, :string
      add :name,       :string


My prior post was wrong. Please see the one below

I think you should be able to ‘flush’ instead, after creating the schema:

1 Like

I believe your approach is correct. I will delete mine to avoid misleading the masses. Thank you.