Merge pull request #1382 from onovy/fix_collate2

Cleanup SQL CHARSET and COLLATE
pull/1384/head
Peter Goodhall 2022-01-26 14:26:48 +00:00 zatwierdzone przez GitHub
commit 5d8ac3e404
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 42 dodań i 3 usunięć

Wyświetl plik

@ -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,

Wyświetl plik

@ -21,8 +21,7 @@ $config['migration_enabled'] = TRUE;
| be upgraded / downgraded to.
|
*/
$config['migration_version'] = 83;
$config['migration_version'] = 84;
/*
|--------------------------------------------------------------------------

Wyświetl plik

@ -0,0 +1,40 @@
<?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',
'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
}
}