defmodule AshPostgres.TestRepo.Migrations.MigrateResources4 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 EXTENSION IF NOT EXISTS \"citext\"") alter table(:posts) do modify :title, :text modify :score, :integer modify :public, :boolean modify :id, :binary_id, null: false add :category, :citext end drop constraint(:comments, "comments_post_id_fkey") alter table(:comments) do modify :title, :text modify :id, :binary_id, null: false modify :post_id, references("posts", type: :binary_id, column: :id) end end def down do execute("DROP EXTENSION IF EXISTS \"citext\"") drop constraint(:comments, "comments_post_id_fkey") alter table(:comments) do modify :post_id, references("posts", type: :binary_id, column: :id) modify :id, :binary_id, null: true modify :title, :text end alter table(:posts) do remove :category modify :id, :binary_id, null: true modify :public, :boolean modify :score, :integer modify :title, :text end end end