Skip to content

Commit

Permalink
fix length of jiscode
Browse files Browse the repository at this point in the history
  • Loading branch information
kanonji committed Sep 27, 2010
1 parent 09812cc commit eb05f6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/schema/zipcodes.php
Expand Up @@ -18,7 +18,7 @@ public function after($event = array()) {
'prefecture_ruby' => array('type' => 'string', 'null' => true, 'default' => NULL),
'city_ruby' => array('type' => 'string', 'null' => true, 'default' => NULL),
'town_ruby' => array('type' => 'string', 'null' => true, 'default' => NULL),
'jiscode' => array('type' => 'integer', 'length' => '5', 'null' => false),
'jiscode' => array('type' => 'string', 'length' => '5', 'null' => false),
'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
Expand Down
4 changes: 2 additions & 2 deletions vendors/shells/zipcode.php
Expand Up @@ -104,7 +104,7 @@ private function save(){
'prefecture_ruby' => mb_convert_kana($recode[3]),
'city_ruby' => mb_convert_kana($recode[4]),
'town_ruby' => mb_convert_kana($recode[5]),
'jiscode' => $recode[0],
'jiscode' => sprintf("%05d",$recode[0]),
);
$this->Zipcode->create();
$this->Zipcode->save($data);
Expand All @@ -124,7 +124,7 @@ private function saveBulk(){
'city' => $recode[4],
'town' => $recode[5],
'block_number' => $recode[6],
'jiscode' => $recode[0],
'jiscode' => sprintf("%05d",$recode[0]),
);
}
$this->Zipcode->create();
Expand Down

0 comments on commit eb05f6b

Please sign in to comment.