ash_postgres/priv/test_repo/migrations/20221217123726_migrate_resources7.exs

38 lines
No EOL
862 B
Elixir

defmodule AshPostgres.TestRepo.Migrations.MigrateResources7 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(:users) do
add :is_active, :boolean
end
create table(:accounts, primary_key: false) do
add :id, :uuid, null: false, default: fragment("uuid_generate_v4()"), primary_key: true
add :is_active, :boolean
add :user_id,
references(:users,
column: :id,
name: "accounts_user_id_fkey",
type: :uuid,
prefix: "public"
)
end
end
def down do
drop constraint(:accounts, "accounts_user_id_fkey")
drop table(:accounts)
alter table(:users) do
remove :is_active
end
end
end