index.community/backend/priv/repo/migrations/20190807182941_remove_crawl_error.exs

19 lines
518 B
Elixir
Raw Normal View History

2019-08-07 19:41:19 +00:00
defmodule Backend.Repo.Migrations.RemoveCrawlError do
use Ecto.Migration
def change do
2019-08-08 09:44:29 +00:00
execute("ALTER TABLE crawls DISABLE TRIGGER ALL", "ALTER TABLE crawls ENABLE TRIGGER ALL")
2019-08-07 19:41:19 +00:00
execute("DELETE FROM crawls WHERE error IS NOT NULL", "")
2019-08-08 09:44:29 +00:00
execute("ALTER TABLE crawls ENABLE TRIGGER ALL", "")
2019-08-07 19:41:19 +00:00
alter table(:crawls) do
remove :error, :string
end
alter table(:instances) do
add :crawl_error, :string
add :crawl_error_count, :integer, default: 0, null: false
end
end
end