mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Remove support for varcharmax
This was originally added inbd9f88587f
(and further refined in160ae441ff
) as a workaround for issues in MySQL < 5.7 and MariaDB < 10.2 related to the default string length when using the recommended utf8mb4 database encoding. As of Laravel 8 the minimum supported versions of MySQL and MariaDB are not affected by this issue so we're now removing this configuration / workaround in Winter v1.2.
This commit is contained in:
parent
ae5b0c2a54
commit
50417b2cb1
@ -58,7 +58,6 @@ return [
|
||||
'unix_socket' => env('DB_SOCKET', ''),
|
||||
'url' => env('DATABASE_URL'),
|
||||
'username' => env('DB_USERNAME', 'winter'),
|
||||
'varcharmax' => 191,
|
||||
],
|
||||
|
||||
'pgsql' => [
|
||||
|
@ -83,9 +83,6 @@ class ServiceProvider extends ModuleServiceProvider
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
// Fix UTF8MB4 support for MariaDB < 10.2 and MySQL < 5.7
|
||||
$this->applyDatabaseDefaultStringLength();
|
||||
|
||||
// Fix use of Storage::url() for local disks that haven't been configured correctly
|
||||
foreach (Config::get('filesystems.disks') as $key => $config) {
|
||||
if ($config['driver'] === 'local' && ends_with($config['root'], '/storage/app') && empty($config['url'])) {
|
||||
@ -610,24 +607,4 @@ class ServiceProvider extends ModuleServiceProvider
|
||||
{
|
||||
View::share('appName', Config::get('app.name'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix UTF8MB4 support for old versions of MariaDB (<10.2) and MySQL (<5.7)
|
||||
*/
|
||||
protected function applyDatabaseDefaultStringLength()
|
||||
{
|
||||
if (Db::getDriverName() !== 'mysql') {
|
||||
return;
|
||||
}
|
||||
|
||||
$defaultStrLen = Db::getConfig('varcharmax');
|
||||
|
||||
if ($defaultStrLen === null && Db::getConfig('charset') === 'utf8mb4') {
|
||||
$defaultStrLen = 191;
|
||||
}
|
||||
|
||||
if ($defaultStrLen !== null) {
|
||||
Schema::defaultStringLength((int) $defaultStrLen);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user