-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat/add default context when it's missing (#69)
* Update extract_message.ex * Update messages_extractor.ex * Create v03.ex * set default context when missing * Update README.md * Create V04.ex * Update V04.ex * mix format
- Loading branch information
Showing
5 changed files
with
33 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
defmodule Kanta.Migrations.Postgresql.V04 do | ||
@moduledoc """ | ||
Kanta V4 Migrations | ||
""" | ||
|
||
use Ecto.Migration | ||
|
||
def up do | ||
Kanta.Migration.up(version: 3) | ||
|
||
execute( | ||
"INSERT INTO kanta_contexts (name,inserted_at,updated_at) VALUES('default', NOW(), NOW()) ON CONFLICT (name) DO NOTHING;" | ||
) | ||
|
||
execute("UPDATE kanta_messages SET context_id=1 WHERE context_id IS NULL;") | ||
end | ||
|
||
def down do | ||
execute("UPDATE kanta_messages SET context_id=NULL WHERE context_id=1;") | ||
|
||
execute("DELETE FROM kanta_contexts WHERE name='default';") | ||
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