DEV Community

Marcøs
Marcøs

Posted on • Edited on

Elixir project setup - config.exs

I'll be writing about typical changes I make to the default phoenix project

See file on GitHub

NOTE: This article assumes you will using Ecto, and the database tables use UUID as the primary key.

  • If you plan on running mix phoenix.gen.model to generate Ecto models, set the generators key to use binary_id for schema’s primary key.
config :portishead,
  generators: [binary_id: true]
Enter fullscreen mode Exit fullscreen mode
  • For mix ecto.migrate with create table syntax, set the migration_primary_key to use uuid. migration_default_prefix is the schema name of the table in postgresql.
config :portishead, Portishead.Repo,
  migration_primary_key: [name: :uuid, type: :uuid],
  migration_default_prefix: "portishead",
  migration_source: "portishead_schema_migrations"
Enter fullscreen mode Exit fullscreen mode

Top comments (0)