1
0
mirror of https://github.com/mgerb/classic-wow-forums synced 2026-01-11 17:42:48 +00:00

server - add hidden fields to thread/reply

This commit is contained in:
2018-01-22 22:29:40 -06:00
parent 66dd5d5b9a
commit d6ec930370
4 changed files with 47 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
defmodule MyApp.Repo.Migrations.ReplyAddHiddenField do
use Ecto.Migration
import Ecto.Query
def up do
alter table(:reply) do
add :hidden, :boolean
end
flush()
from(r in "reply",
update: [set: [hidden: false]])
|> MyApp.Repo.update_all([])
end
def down do
alter table(:reply) do
remove :hidden
end
end
end

View File

@@ -0,0 +1,22 @@
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