1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2026-01-20 14:49:53 +00:00

Change SQL charset for message_db to utf8mb4

هذا الالتزام موجود في:
Petter Helset
2017-10-26 13:49:57 +02:00
الأصل 67d0f6514d
التزام 3d8d3956fe
2 ملفات معدلة مع 3 إضافات و3 حذوفات

عرض الملف

@@ -7,7 +7,7 @@ module Postal
# it would be undesirable as we'd just end up with lots of connections. # it would be undesirable as we'd just end up with lots of connections.
def self.new_client 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 end
@free_clients = [] @free_clients = []

عرض الملف

@@ -33,7 +33,7 @@ module Postal
# Creates a new empty database # Creates a new empty database
# #
def create 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 true
rescue Mysql2::Error => e rescue Mysql2::Error => e
e.message =~ /database exists/ ? false : raise e.message =~ /database exists/ ? false : raise
@@ -185,7 +185,7 @@ module Postal
s << ", PRIMARY KEY (`id`)" s << ", PRIMARY KEY (`id`)"
end end
s << ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;" s << ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;"
end end
end end