mirror of
https://github.com/ash-project/ash_postgres.git
synced 2024-09-21 05:53:18 +12:00
32 lines
692 B
Elixir
32 lines
692 B
Elixir
defmodule AshPostgres.TestRepo.Migrations.MigrateResources25 do
|
|
@moduledoc """
|
|
Updates resources based on their most recent snapshots.
|
|
|
|
This file was autogenerated with `mix ash_postgres.generate_migrations`
|
|
"""
|
|
|
|
use Ecto.Migration
|
|
|
|
def up do
|
|
alter table(:posts) do
|
|
add(:uniq_on_upper, :text)
|
|
end
|
|
|
|
create(
|
|
unique_index(:posts, ["UPPER(uniq_on_upper)"],
|
|
where: "type = 'sponsored'",
|
|
name: "posts_uniq_on_upper_index"
|
|
)
|
|
)
|
|
end
|
|
|
|
def down do
|
|
drop_if_exists(
|
|
unique_index(:posts, ["UPPER(uniq_on_upper)"], name: "posts_uniq_on_upper_index")
|
|
)
|
|
|
|
alter table(:posts) do
|
|
remove(:uniq_on_upper)
|
|
end
|
|
end
|
|
end
|