Skip to content

Instantly share code, notes, and snippets.

@shankardevy
Created July 15, 2017 05:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shankardevy/fc7ca2527dda0ab4790037b9f62e29b9 to your computer and use it in GitHub Desktop.
Save shankardevy/fc7ca2527dda0ab4790037b9f62e29b9 to your computer and use it in GitHub Desktop.
defmodule Mango.Repo.Migrations.CreateProduct do
use Ecto.Migration
def change do
create table(:products) do
add :name, :string
add :price, :decimal
add :sku, :string
add :is_seasonal, :boolean, default: false, null: false
add :image, :string
add :pack_size, :string
add :category, :string
timestamps()
end
create unique_index(:products, [:sku])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment