From 186abbd9cf1f97e2eafc7f93f1a8d344d0845499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tao=20Bror=20Bojl=C3=A9n?= Date: Thu, 8 Aug 2019 12:44:29 +0300 Subject: [PATCH] more performant deletes --- .../priv/repo/migrations/20190807182941_remove_crawl_error.exs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/priv/repo/migrations/20190807182941_remove_crawl_error.exs b/backend/priv/repo/migrations/20190807182941_remove_crawl_error.exs index 162c55d..2eff1d8 100644 --- a/backend/priv/repo/migrations/20190807182941_remove_crawl_error.exs +++ b/backend/priv/repo/migrations/20190807182941_remove_crawl_error.exs @@ -2,7 +2,9 @@ defmodule Backend.Repo.Migrations.RemoveCrawlError do use Ecto.Migration def change do + execute("ALTER TABLE crawls DISABLE TRIGGER ALL", "ALTER TABLE crawls ENABLE TRIGGER ALL") execute("DELETE FROM crawls WHERE error IS NOT NULL", "") + execute("ALTER TABLE crawls ENABLE TRIGGER ALL", "") alter table(:crawls) do remove :error, :string