cloudlog/application/migrations/263_notes_utf8mb4_columns.php
Peter Goodhall 3be655e64d Add migration to convert notes to utf8mb4
Bump migration_version to 263 and add Migration_notes_utf8mb4_columns. The new migration converts the notes table to use utf8mb4 with utf8mb4_unicode_ci to support emoji and other 4-byte characters; down() reverts the table back to utf8 with utf8_general_ci.
2026-03-29 23:07:32 +01:00

20 lines
518 B
PHP

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
* Convert notes table columns to utf8mb4 to support emoji and other 4-byte characters
*/
class Migration_notes_utf8mb4_columns extends CI_Migration {
public function up()
{
$this->db->query("ALTER TABLE notes CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;");
}
public function down()
{
$this->db->query("ALTER TABLE notes CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;");
}
}