codefordurham/Durham-Restaurants — pull request #101 by tamcap (2014-04-24 20:11:29+00:00)
Title: [fixes #92] If phone=0 make it a null in the DB.

Fixes #92.

If the phone number for establishment from the Durham API, save it into our DB as Null instead.

* makes the phone number nullable in the model
* clean code in the form

Database needs to migrated or adjusted manually (that's what I did).

ALTER TABLE inspections_establishment ALTER COLUMN phone_number DROP NOT NULL;
UPDATE inspections_establishment SET phone_number=Null WHERE phone_number='0';