fix note image references
This commit is contained in:
parent
a8f037cff2
commit
cf8dd95064
1 changed files with 17 additions and 0 deletions
|
@ -0,0 +1,17 @@
|
||||||
|
defmodule Chiya.Repo.Migrations.FixNoteImageReference do
|
||||||
|
use Ecto.Migration
|
||||||
|
|
||||||
|
def up do
|
||||||
|
drop constraint :note_images, "note_images_note_id_fkey"
|
||||||
|
alter table(:note_images) do
|
||||||
|
modify :note_id, references(:notes, on_delete: :delete_all)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down do
|
||||||
|
drop constraint :note_images, "note_images_note_id_fkey"
|
||||||
|
alter table(:note_images) do
|
||||||
|
modify :note_id, references(:notes, on_delete: :nothing)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue