more performant deletes

This commit is contained in:
Tao Bror Bojlén 2019-08-08 12:44:29 +03:00
parent 30c5bbe2b9
commit 186abbd9cf
No known key found for this signature in database
GPG key ID: C6EC7AAB905F9E6F

View file

@ -2,7 +2,9 @@ defmodule Backend.Repo.Migrations.RemoveCrawlError do
use Ecto.Migration use Ecto.Migration
def change do 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("DELETE FROM crawls WHERE error IS NOT NULL", "")
execute("ALTER TABLE crawls ENABLE TRIGGER ALL", "")
alter table(:crawls) do alter table(:crawls) do
remove :error, :string remove :error, :string