مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2026-01-19 14:19:48 +00:00
Change SQL charset for message_db to utf8mb4
هذا الالتزام موجود في:
@@ -7,7 +7,7 @@ module Postal
|
||||
# it would be undesirable as we'd just end up with lots of connections.
|
||||
|
||||
def self.new_client
|
||||
Mysql2::Client.new(:host => Postal.config.message_db.host, :username => Postal.config.message_db.username, :password => Postal.config.message_db.password, :port => Postal.config.message_db.port, :reconnect => true)
|
||||
Mysql2::Client.new(:host => Postal.config.message_db.host, :username => Postal.config.message_db.username, :password => Postal.config.message_db.password, :port => Postal.config.message_db.port, :reconnect => true, :encoding => Postal.config.message_db.encoding || 'utf8mb4')
|
||||
end
|
||||
|
||||
@free_clients = []
|
||||
|
||||
@@ -33,7 +33,7 @@ module Postal
|
||||
# Creates a new empty database
|
||||
#
|
||||
def create
|
||||
@database.query("CREATE DATABASE `#{@database.database_name}` CHARSET utf8 COLLATE UTF8_UNICODE_CI;")
|
||||
@database.query("CREATE DATABASE `#{@database.database_name}` CHARSET utf8mb4 COLLATE utf8mb4_bin;")
|
||||
true
|
||||
rescue Mysql2::Error => e
|
||||
e.message =~ /database exists/ ? false : raise
|
||||
@@ -185,7 +185,7 @@ module Postal
|
||||
s << ", PRIMARY KEY (`id`)"
|
||||
end
|
||||
|
||||
s << ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
|
||||
s << ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم