Skip to content

v1.0.1

Choose a tag to compare

@awcodes awcodes released this 31 Aug 16:01
· 11 commits to 1.x since this release

Fixed

  • The seed command no longer empties the postal_codes table before it has data to replace it with.

truncate() ran as the first statement in handle(), before the archive was downloaded or extracted. A mistyped country code, a network failure or an unreadable archive therefore emptied the table and returned FAILURE with nothing to put back — three separate failure paths sat after the truncate. The docs already stated that a failed download "exits without changing the table", which was not true until now.

The table is emptied immediately before the import instead, once the data file is in hand, and the archive is now checked for that file rather than letting the import throw. Behaviour on a successful seed is unchanged: the table still holds one country at a time.

Anyone on v1.0.0 running postal-codes:seed against a bad country code or a flaky connection could lose their imported data.