mirror of
https://github.com/ash-project/ash_postgres.git
synced 2024-09-20 13:33:50 +12:00
32 lines
870 B
Elixir
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
|