Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #109 from s-nakajima/master
多言語化対応(is_original_copyフィールド追加)
- Loading branch information
Showing
3 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?php | ||
/** | ||
* 多言語化対応 | ||
* | ||
* @author Shohei Nakajima <nakajimashouhei@gmail.com> | ||
* @link http://www.netcommons.org NetCommons Project | ||
* @license http://www.netcommons.org/license.txt NetCommons License | ||
* @copyright Copyright 2014, NetCommons Project | ||
*/ | ||
|
||
App::uses('NetCommonsMigration', 'NetCommons.Config/Migration'); | ||
|
||
/** | ||
* 多言語化対応 | ||
* | ||
* @author Shohei Nakajima <nakajimashouhei@gmail.com> | ||
* @package NetCommons\Bbses\Config\Migration | ||
*/ | ||
class AddIsOriginalCopy extends NetCommonsMigration { | ||
|
||
/** | ||
* Migration description | ||
* | ||
* @var string | ||
*/ | ||
public $description = 'add_is_original_copy'; | ||
|
||
/** | ||
* Actions to be performed | ||
* | ||
* @var array $migration | ||
*/ | ||
public $migration = array( | ||
'up' => array( | ||
'create_field' => array( | ||
'bbs_articles' => array( | ||
'is_original_copy' => array('type' => 'boolean', 'null' => false, 'default' => '0', 'comment' => 'オリジナルのコピー。言語を新たに追加したときに使用する', 'after' => 'is_translation'), | ||
), | ||
'bbses' => array( | ||
'is_original_copy' => array('type' => 'boolean', 'null' => false, 'default' => '0', 'comment' => 'オリジナルのコピー。言語を新たに追加したときに使用する', 'after' => 'is_translation'), | ||
), | ||
), | ||
), | ||
'down' => array( | ||
'drop_field' => array( | ||
'bbs_articles' => array('is_original_copy'), | ||
'bbses' => array('is_original_copy'), | ||
), | ||
), | ||
); | ||
|
||
/** | ||
* Before migration callback | ||
* | ||
* @param string $direction Direction of migration process (up or down) | ||
* @return bool Should process continue | ||
*/ | ||
public function before($direction) { | ||
return true; | ||
} | ||
|
||
/** | ||
* After migration callback | ||
* | ||
* @param string $direction Direction of migration process (up or down) | ||
* @return bool Should process continue | ||
*/ | ||
public function after($direction) { | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters