Skip to content

Instantly share code, notes, and snippets.

View ngoclinhng's full-sized avatar

Linh Ngoc ngoclinhng

  • Ho Chi Minh City, Vietnam
View GitHub Profile
@ngoclinhng
ngoclinhng / create_post.exs
Created November 14, 2021 17:09 — forked from stevedomin/create_post.exs
Using UUIDs as primary key with Ecto
defmodule MyBlog.Repo.Migrations.CreatePost do
use Ecto.Migration
def change do
create table(:posts, primary_key: false) do
add :id, :uuid, primary_key: true
add :body, :string
add :word_count, :integer
timestamps