v1.0.1
Fixed
- The seed command no longer empties the
postal_codestable 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.