Skip to content

Commit

Permalink
HELP-37414: Ensure outbound fax migrate uses same options as move_doc…
Browse files Browse the repository at this point in the history
… in fax_worker (#4909)

formatting
  • Loading branch information
swysor authored and jamesaimonetti committed Jun 11, 2018
1 parent acfafe1 commit 368a444
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions applications/fax/src/fax_maintenance.erl
Expand Up @@ -25,7 +25,11 @@
-export([versions_in_use/0]).

-define(DEFAULT_MIGRATE_OPTIONS, [{'allow_old_modb_creation', 'true'}]).
-define(OVERRIDE_DOCS, ['override_existing_document' | ?DEFAULT_MIGRATE_OPTIONS]).
-define(OVERRIDE_DOCS, ['override_existing_document'
,{'transform', fun(_, B) -> kz_json:set_value(<<"folder">>, <<"outbox">>, B) end}
|?DEFAULT_MIGRATE_OPTIONS
]
).
-define(DEFAULT_BATCH_SIZE, 100).

-spec migrate() -> 'ok'.
Expand Down Expand Up @@ -181,9 +185,9 @@ migrate_fax_to_modb(AccountDb, DocId, JObj, Options) ->
AccountMODb = kazoo_modb:get_modb(AccountDb, Year, Month),
FaxMODb = kz_util:format_account_modb(AccountMODb, 'encoded'),
FaxId = <<(kz_term:to_binary(Year))/binary
,(kz_date:pad_month(Month))/binary
,"-"
,DocId/binary
,(kz_date:pad_month(Month))/binary
,"-"
,DocId/binary
>>,
io:format("moving doc ~s/~s to ~s/~s~n",[AccountDb, DocId, AccountMODb, FaxId]),
case kazoo_modb:move_doc(AccountDb, DocId, FaxMODb, FaxId, Options) of
Expand Down

0 comments on commit 368a444

Please sign in to comment.