Update DBIServer to add a relationship to itself and the sync on attribute.

This commit is contained in:
2025-05-04 21:49:13 +03:00
parent 0415938248
commit 2d78c2bd1b
3 changed files with 174 additions and 2 deletions
@@ -0,0 +1,32 @@
defmodule DecentralisedBookIndex.Repo.Migrations.UpdateDbiServerToAddRelationshipToItselfAndSyncOnAttribute 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(:dbi_servers) do
add :sync_on?, :boolean, default: false
add :dbi_server_id,
references(:dbi_servers,
column: :id,
name: "dbi_servers_dbi_server_id_fkey",
type: :uuid,
prefix: "public"
)
end
end
def down do
drop constraint(:dbi_servers, "dbi_servers_dbi_server_id_fkey")
alter table(:dbi_servers) do
remove :dbi_server_id
remove :sync_on?
end
end
end