kopia lustrzana https://github.com/magicbug/Cloudlog
Cleanup SQL CHARSET and COLLATE
* Set same charset and collate for all tables * Recommends collate utf8mb4_0900_ai_ci which is MySQL defaultpull/1382/head
rodzic
e086dc4070
commit
216aaff844
|
@ -88,7 +88,7 @@ $db['default'] = array(
|
|||
'cache_on' => FALSE,
|
||||
'cachedir' => '',
|
||||
'char_set' => 'utf8mb4',
|
||||
'dbcollat' => 'utf8mb4_general_ci',
|
||||
'dbcollat' => 'utf8mb4_0900_ai_ci',
|
||||
'swap_pre' => '',
|
||||
'encrypt' => FALSE,
|
||||
'compress' => FALSE,
|
||||
|
|
|
@ -21,8 +21,7 @@ $config['migration_enabled'] = TRUE;
|
|||
| be upgraded / downgraded to.
|
||||
|
|
||||
*/
|
||||
|
||||
$config['migration_version'] = 83;
|
||||
$config['migration_version'] = 84;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class Migration_fix_collate extends CI_Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$tables = array(
|
||||
$this->config->item('table_name'),
|
||||
'adif_modes',
|
||||
'api',
|
||||
'cat',
|
||||
'config',
|
||||
'contest',
|
||||
'dxcc_entities',
|
||||
'dxcc_exceptions',
|
||||
'dxcc_prefixes',
|
||||
'eQSL_images',
|
||||
'iota',
|
||||
'lotw_certs',
|
||||
'migrations',
|
||||
'notes',
|
||||
'options',
|
||||
'qsl_images',
|
||||
'queries',
|
||||
'station_logbooks',
|
||||
'station_logbooks_relationship',
|
||||
'station_profile',
|
||||
'timezones',
|
||||
'users'
|
||||
);
|
||||
foreach ($tables as $table) {
|
||||
$this->db->query('ALTER TABLE ' . $table . ' CONVERT TO CHARACTER SET ' . $this->db->char_set . ' COLLATE ' . $this->db->dbcollat);
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
// Not Possible
|
||||
}
|
||||
}
|
Ładowanie…
Reference in New Issue