DEV Community

Marcøs
Marcøs

Posted on • Edited on

2 2

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

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay