mirror of
https://github.com/mgerb/classic-wow-forums
synced 2026-01-09 16:42:49 +00:00
23 lines
372 B
Elixir
23 lines
372 B
Elixir
defmodule MyApp.Repo.Migrations.ThreadAddHiddenField do
|
|
use Ecto.Migration
|
|
import Ecto.Query
|
|
|
|
def up do
|
|
alter table(:thread) do
|
|
add :hidden, :boolean
|
|
end
|
|
|
|
flush()
|
|
|
|
from(r in "thread",
|
|
update: [set: [hidden: false]])
|
|
|> MyApp.Repo.update_all([])
|
|
end
|
|
|
|
def down do
|
|
alter table(:thread) do
|
|
remove :hidden
|
|
end
|
|
end
|
|
end
|