-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Curaçao name from m13 migration file. File was set to ANSI.
- Loading branch information
Showing
3 changed files
with
52 additions
and
3 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
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,49 @@ | ||
<?php | ||
/** | ||
* | ||
* @package National Flags | ||
* @copyright (c) 2020 Rich Mcgirr (RMcGirr83) | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 | ||
* | ||
*/ | ||
|
||
namespace rmcgirr83\nationalflags\migrations; | ||
|
||
class m14_update_data extends \phpbb\db\migration\migration | ||
{ | ||
static public function depends_on() | ||
{ | ||
return ['\rmcgirr83\nationalflags\migrations\m13_update_data']; | ||
} | ||
|
||
public function update_data() | ||
{ | ||
return [ | ||
['custom', [ | ||
[&$this, 'flag_update_image'] | ||
]], | ||
]; | ||
} | ||
|
||
public function flag_update_image() | ||
{ | ||
if ($this->db_tools->sql_table_exists($this->table_prefix . 'flags')) | ||
{ | ||
$sql_ary = [ | ||
[ | ||
'flag_name' => 'Curaçao', | ||
'flag_image' => 'cw.png', | ||
], | ||
]; | ||
foreach ($sql_ary as $num => $flag) | ||
{ | ||
$sql = 'UPDATE ' . $this->table_prefix . 'flags | ||
SET ' . $this->db->sql_build_array('UPDATE', [ | ||
'flag_name' => (string) $flag['flag_name']] | ||
) . | ||
" WHERE flag_image = '" . (string) $flag['flag_image'] . "'"; | ||
$this->db->sql_query($sql); | ||
} | ||
} | ||
} | ||
} |