mirror of
https://github.com/ash-project/ash_postgres.git
synced 2024-09-20 21:43:12 +12:00
34 lines
800 B
Elixir
34 lines
800 B
Elixir
|
defmodule AshPostgres.TestRepo.Migrations.MigrateResources38 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(:post_permalinks, primary_key: false) do
|
||
|
add(:id, :uuid, null: false, default: fragment("gen_random_uuid()"), primary_key: true)
|
||
|
|
||
|
add(
|
||
|
:post_id,
|
||
|
references(:posts,
|
||
|
column: :id,
|
||
|
name: "post_permalinks_post_id_fkey",
|
||
|
type: :uuid,
|
||
|
prefix: "public",
|
||
|
on_delete: :nothing
|
||
|
),
|
||
|
null: false
|
||
|
)
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def down do
|
||
|
drop(constraint(:post_permalinks, "post_permalinks_post_id_fkey"))
|
||
|
|
||
|
drop(table(:post_permalinks))
|
||
|
end
|
||
|
end
|