I'm trying to rename the primary key from :id to :account_id.
I've got the following Schema and migration. When I try to insert a record, I get a 'cannot be null' error from Postgres on the account_id column.
Did I set up the autogenerate bit right? I feel like that should be in the migration.
def change do
create table(:accounts) do
add :account_id, :integer, primary_key: true
add :email, :string
timestamps()
end
end
@primary_key {:account_id, :id, autogenerate: true}
schema "accounts" do
field :email, :string
timestamps()
end