@@ -667,7 +667,7 @@ private function setupModuleRegistry(SchemaSetupInterface $setup)
667667 $ columns = ['module ' => ['varchar(50) ' ,'' ],
668668 'schema_version ' => ['varchar(50) ' ,'' ],
669669 'data_version ' => ['varchar(50) ' ,'' ]];
670- $ this ->setColumnCollationAndCharset ($ tableName , $ columns , $ connection );
670+ $ this ->setDefaultCharsetAndCollation ($ tableName , $ columns , $ connection );
671671 }
672672 }
673673 }
@@ -734,7 +734,7 @@ private function setupSessionTable(
734734 if (preg_match ('/\b( ' . self ::OLDCHARSET .')\b/ ' , $ getTableSchema )) {
735735 $ tableName = $ setup ->getTable ('session ' );
736736 $ columns = ['session_id ' => ['varchar(255) ' ,'' ]];
737- $ this ->setColumnCollationAndCharset ($ tableName , $ columns , $ connection );
737+ $ this ->setDefaultCharsetAndCollation ($ tableName , $ columns , $ connection );
738738 }
739739 }
740740 }
@@ -797,7 +797,7 @@ private function setupCacheTable(
797797 if (preg_match ('/\b( ' . self ::OLDCHARSET .')\b/ ' , $ getTableSchema )) {
798798 $ tableName = $ setup ->getTable ('cache ' );
799799 $ columns = ['id ' => ['varchar(200) ' ,'' ]];
800- $ this ->setColumnCollationAndCharset ($ tableName , $ columns , $ connection );
800+ $ this ->setDefaultCharsetAndCollation ($ tableName , $ columns , $ connection );
801801 }
802802 }
803803 }
@@ -842,7 +842,7 @@ private function setupCacheTagTable(
842842 if (preg_match ('/\b( ' . self ::OLDCHARSET .')\b/ ' , $ getTableSchema )) {
843843 $ tableName = $ setup ->getTable ('cache_tag ' );
844844 $ columns = ['tag ' => ['varchar(100) ' ,'' ],'cache_id ' => ['varchar(200) ' ,'' ]];
845- $ this ->setColumnCollationAndCharset ($ tableName , $ columns , $ connection );
845+ $ this ->setDefaultCharsetAndCollation ($ tableName , $ columns , $ connection );
846846 }
847847 }
848848 }
@@ -906,7 +906,7 @@ private function setupFlagTable(
906906 $ getTableSchema = $ connection ->getCreateTable ($ tableName ) ?? '' ;
907907 if (preg_match ('/\b( ' . self ::OLDCHARSET .')\b/ ' , $ getTableSchema )) {
908908 $ columns = ['flag_code ' => ['varchar(255) ' ,'NOT NULL ' ],'flag_data ' => ['mediumtext ' ,'' ]];
909- $ this ->setColumnCollationAndCharset ($ tableName , $ columns , $ connection );
909+ $ this ->setDefaultCharsetAndCollation ($ tableName , $ columns , $ connection );
910910 }
911911 }
912912 }
@@ -1884,14 +1884,14 @@ private function reindexAll(): void
18841884 }
18851885
18861886 /**
1887- * Add column attribute and update table
1887+ * Set default collation & charset (e.g.,utf8mb4_general_ci & utf8mb4) for core setup tables
18881888 *
18891889 * @param string $tableName
18901890 * @param array $columns
18911891 * @param AdapterInterface $connection
18921892 * @return void
18931893 */
1894- private function setColumnCollationAndCharset (string $ tableName , array $ columns , $ connection ) : void
1894+ private function setDefaultCharsetAndCollation (string $ tableName , array $ columns , $ connection ) : void
18951895 {
18961896 $ charset = $ this ->columnConfig ->getDefaultCharset ();
18971897 $ collate = $ this ->columnConfig ->getDefaultCollation ();
0 commit comments