ash_postgres/priv/test_repo/migrations/20220522220601_migrate_resources5.exs
2022-05-22 18:30:20 -04:00

32 lines
870 B
Elixir

defmodule AshPostgres.TestRepo.Migrations.MigrateResources5 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
execute "CREATE SCHEMA profiles"
create table(:profile, primary_key: false, prefix: "profiles") do
add :id, :uuid, null: false, default: fragment("uuid_generate_v4()"), primary_key: true
add :description, :text
add :author_id,
references(:authors,
column: :id,
name: "profile_author_id_fkey",
type: :uuid,
prefix: "public"
)
end
end
def down do
execute "DROP SCHEMA profiles"
drop constraint(:profile, "profile_author_id_fkey", prefix: "profiles")
drop table(:profile, prefix: "profiles")
end
end