ash_postgres/priv/test_repo/migrations/20230526144249_migrate_resources9.exs
Tommaso Patrizi 96165a58ea
tests: added test for bulk upsert (#148)
Co-authored-by: Tommaso Patrizi <tommasop@gmail.com>
2023-05-26 23:58:04 -04:00

37 lines
No EOL
1,022 B
Elixir

defmodule AshPostgres.TestRepo.Migrations.MigrateResources9 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
create table(:managers, primary_key: false) do
add :id, :uuid, null: false, default: fragment("uuid_generate_v4()"), primary_key: true
add :name, :text
add :code, :text, null: false
add :must_be_present, :text, null: false
add :role, :text
add :organization_id,
references(:orgs,
column: :id,
name: "managers_organization_id_fkey",
type: :uuid,
prefix: "public"
)
end
create unique_index(:managers, [:code], name: "managers_uniq_code_index")
end
def down do
drop_if_exists unique_index(:managers, [:code], name: "managers_uniq_code_index")
drop constraint(:managers, "managers_organization_id_fkey")
drop table(:managers)
end
end