-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9e21f4a
commit 4f6496d
Showing
5 changed files
with
185 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?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\Topics\Config\Migration | ||
* @see https://github.com/NetCommons3/NetCommons3/issues/1620 | ||
*/ | ||
class AddImageUrl extends NetCommonsMigration { | ||
|
||
/** | ||
* Migration description | ||
* | ||
* @var string | ||
*/ | ||
public $description = 'add_image_url'; | ||
|
||
/** | ||
* Actions to be performed | ||
* | ||
* @var array $migration | ||
*/ | ||
public $migration = array( | ||
'up' => array( | ||
'create_field' => array( | ||
'topics' => array( | ||
'thumbnail_path' => array('type' => 'string', 'null' => true, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8', 'after' => 'title_icon'), | ||
), | ||
), | ||
), | ||
'down' => array( | ||
'drop_field' => array( | ||
'topics' => array('thumbnail_path'), | ||
), | ||
), | ||
); | ||
|
||
/** | ||
* 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; | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
Config/Migration/1610073630_add_column_display_thumbnail.php
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,68 @@ | ||
<?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\Topics\Config\Migration | ||
* @see https://github.com/NetCommons3/NetCommons3/issues/1620 | ||
*/ | ||
class AddColumnDisplayThumbnail extends NetCommonsMigration { | ||
|
||
/** | ||
* Migration description | ||
* | ||
* @var string | ||
*/ | ||
public $description = 'add_column_display_thumbnail'; | ||
|
||
/** | ||
* Actions to be performed | ||
* | ||
* @var array $migration | ||
*/ | ||
public $migration = array( | ||
'up' => array( | ||
'create_field' => array( | ||
'topic_frame_settings' => array( | ||
'display_thumbnail' => array('type' => 'boolean', 'null' => false, 'default' => '1', 'after' => 'display_title'), | ||
), | ||
), | ||
), | ||
'down' => array( | ||
'drop_field' => array( | ||
'topic_frame_settings' => array('display_thumbnail'), | ||
), | ||
), | ||
); | ||
|
||
/** | ||
* 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
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