-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
priv/repo/migrations/20170106013143_add_editable_to_task_lists.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
defmodule CodeCorps.Repo.Migrations.AddEditableToTaskLists do | ||
alias CodeCorps.{Repo, TaskList} | ||
|
||
import Ecto.Query | ||
|
||
use Ecto.Migration | ||
|
||
def up do | ||
alter table(:task_lists) do | ||
add :inbox, :boolean, default: false | ||
end | ||
|
||
flush | ||
|
||
TaskList | ||
|> where([task_list], task_list.name == "Inbox") | ||
|> Repo.update_all(set: [inbox: true]) | ||
end | ||
|
||
def down do | ||
alter table(:task_lists) do | ||
remove :inbox | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters