Current section

Files

Jump to
blossom lib blossom migrations postgres v06.ex
Raw

lib/blossom/migrations/postgres/v06.ex

defmodule Blossom.Migrations.Postgres.V06 do
use Ecto.Migration
def up(_opts) do
create table(:settings, primary_key: false) do
add(:id, :uuid,
primary_key: true,
default: fragment("uuid_generate_v4()")
)
add(:name, :string, null: false)
add(:value, :string, null: false)
add(:inserted_at, :naive_datetime,
null: false,
default: fragment("now()")
)
add(:updated_at, :naive_datetime, null: false, default: fragment("now()"))
end
create(unique_index(:settings, [:name]))
end
def down(_opts) do
drop(index(:settings, [:name]))
drop(table(:settings))
end
end