uuid_helper_module v0.0.2 UuidHelperModule.UUIDMigration

Contains functions to add uuid columns to a table during migrations

Link to this section Summary

Functions

Adds an index on uuid column of the given table

Adds uuid column to a table.

Link to this section Functions

Link to this function

create_index_on_uuid(table_name)

Adds an index on uuid column of the given table

Parameters

  • table_name: the table for which the index has to be created

Adds uuid column to a table.

defmodule MyApp.Repo.Migrations.CreateUser do
  use Ecto.Migration

  import UuidHelperModule.UUIDMigration

  def change do
    create table(:users) do
      add :name, :string

      uuid_column()
    end
  end
end