{@inheritdoc}

@see \Doctrine\DBAL\Driver\AbstractMySQLDriver::createDatabasePlatformForVersion()
334251
public function createDatabasePlatformForVersion($version)
    {
        if (false === stripos($version, 'mariadb')) {
            if (preg_match('/^(\d+)/', $version, $match)) {
                if ((int) $match[1] >= 8) {
                    return new MySQL80Platform();
                }
            }
        }

        return parent::createDatabasePlatformForVersion($version);
    }
1332788
public static function isCurrentVersionNewerThanDatabaseVersion()
    {
        $app = Application::getFacadeApplication();
        $db = $app->make(Connection::class);
        $config = $app->make('config');
        $database = $db->fetchColumn('select max(version) from SystemDatabaseMigrations');
        $code = $config->get('concrete.version_db');

        return $database < $code;
    }
297527
protected function createDatabase()
    {
        /** @var Container $container */
        $container = $this->console->container;

        $dbService = $container->get(DatabaseService::class);
        $config    = $dbService->getDbConfig();

        // Auto create database
        $name = $config['name'];

        $config['name'] = null;

        $db = $dbService->createConnection('_preset', $config->toArray());

        $db->getDatabase($name)->create(true);

        $db->select($name);

        $config['name'] = $name;
    }
1180079
public function mapOsVersion(?string $osVersion, ?string $osName = null): VersionInterface
    {
        return (new PlatformVersionMapper())->mapOsVersion($osVersion, $osName);
    }
1028138
public function getPlatformVersion() { 
		if ($this->_platformVersion === self::PLATFORM_UNKNOWN ) 
		{
			$this->_platformVersion = $this->_platform;
		}
		return $this->_platformVersion; 
	}
878858
private function buildInsertTranslatablePlacesSQL(PackageVersionEntity $packageVersion, $numRecords)
    {
        $fields = '(packageVersion, translatable, locations, comments, sort)';
        $values = '(' . $packageVersion->getID() . ', ?, ?, ?, ?),';
        $sql = 'INSERT INTO CommunityTranslationTranslatablePlaces ';
        $sql .= ' ' . $fields;
        $sql .= ' VALUES ' . rtrim(str_repeat($values, $numRecords), ',');

        return $sql;
    }
476648
public function getMappedDatabaseTypes(AbstractPlatform $platform): array
    {
        if ($platform instanceof MySqlPlatform) {
            return \array_merge(parent::getMappedDatabaseTypes($platform), ['enum']);
        }

        return parent::getMappedDatabaseTypes($platform);
    }
1356465
public function scopeCurrentVersion(Builder $query)
    {
        $subquery = $this->getCurrentVersionQuery();

        return $query
            ->select('version.*')
            ->addSelect('version.id as version:id')
            ->addSelect('version.created_at as version:created_at')
            ->addSelect('version.created_by as version:created_by')
            ->addSelect('pages.*')
            ->join(DB::raw('('.$subquery->toSql().') as v2'), 'pages.id', '=', 'v2.page_id')
            ->mergeBindings($subquery)
            ->join('page_versions as version', function (JoinClause $join) {
                $join
                    ->on('pages.id', '=', 'version.page_id')
                    ->on('v2.id', '=', 'version.id');
            });
    }
779033
public function upgradeDatabase()
    {
        $config = $this->app->make('config');
        $resolver = $this->app->make(Resolver::class);
        $error = null;
        try {
            list($characterSet, $collation) = $resolver
                ->setCharacterSet((string) $config->get('database.preferred_character_set'))
                ->setCollation((string) $config->get('database.preferred_collation'))
                ->resolveCharacterSetAndCollation($this->connection)
            ;
        } catch (CharacterSetCollationException $x) {
            try {
                list($characterSet, $collation) = $resolver
                    ->setCharacterSet((string) $config->get('database.fallback_character_set'))
                    ->setCollation((string) $config->get('database.fallback_collation'))
                    ->resolveCharacterSetAndCollation($this->connection)
                ;
            } catch (Exception $x) {
                $error = $x;
            }
        } catch (Throwable $x) {
            $error = $x;
        }
        if ($error !== null) {
            $this->output(t('Failed to resolve the database character set and collation: %s', $error->getMessage()));

            return;
        }
        $params = $this->connection->getParams();
        if (isset($params['character_set']) && $params['character_set'] === $characterSet && isset($params['collation']) && $params['collation'] === $collation) {
            return;
        }
        $manager = $this->app->make(Manager::class);
        try {
            $manager->apply(
                $characterSet,
                $collation,
                '',
                '',
                function ($message) {
                    $this->output($message);
                }
            );
        } catch (Exception $x) {
            $this->output(t('Failed to set character sets: %s', $x->getMessage()));
        } catch (Throwable $x) {
            $this->output(t('Failed to set character sets: %s', $x->getMessage()));
        }
    }
1027463
public static function buildTableMap()
    {
      $dbMap = Propel::getServiceContainer()->getDatabaseMap(PersonFunctionVersionTableMap::DATABASE_NAME);
      if (!$dbMap->hasTable(PersonFunctionVersionTableMap::TABLE_NAME)) {
        $dbMap->addTableObject(new PersonFunctionVersionTableMap());
      }
    }
345556
public function convertToDatabaseValue($value, AbstractPlatform $platform)
    {
        if (null === $value) {
            return $this->onNullFromPhp();
        }

        return $value->getValue();
    }
412842
public function upgradeDatabase()
    {
        $db = $this->connection;
        $db->executeQuery("UPDATE FileImageThumbnailPaths SET thumbnailFormat = ? WHERE thumbnailFormat = '' AND (path LIKE '%.jpg' OR path LIKE '%.jpeg' OR path LIKE '%.pjpg' OR path LIKE '%.pjpeg')", [BitmapFormat::FORMAT_JPEG]);
        $db->executeQuery("UPDATE FileImageThumbnailPaths SET thumbnailFormat = ? WHERE thumbnailFormat = ''", [BitmapFormat::FORMAT_PNG]);
    }
962296
public function upgradeDatabase()
    {
        $this->refreshEntities([
            ThumbnailTypeEntity::class,
            ThumbnailTypeFileSet::class,
        ]);

        $type = Type::getByHandle('file_manager_detail');
        if ($type) {
            /*
             * Fix issue where file manager detail thumbnails were being added without a height.
             *
             * @var \Concrete\Core\Entity\File\Image\Thumbnail\Type\Type $type
             */
            if (!$type->getHeight()) {
                $type->setHeight($type->getWidth());
                $em = $this->connection->getEntityManager();
                $em->persist($type);
                $em->flush();
            }
        }
    }
97875
public function convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform)
    {
        if ($platform instanceof MySqlPlatform) {
            return sprintf('PointFromText(%s)', $sqlExpr);
        } else {
            return parent::convertToDatabaseValueSQL($sqlExpr, $platform);
        }
    }
736849
public static function buildTableMap()
    {
      $dbMap = Propel::getServiceContainer()->getDatabaseMap(PersonTeamLinkVersionTableMap::DATABASE_NAME);
      if (!$dbMap->hasTable(PersonTeamLinkVersionTableMap::TABLE_NAME)) {
        $dbMap->addTableObject(new PersonTeamLinkVersionTableMap());
      }
    }
276443
public static function buildTableMap()
    {
      $dbMap = Propel::getServiceContainer()->getDatabaseMap(DealerContactVersionTableMap::DATABASE_NAME);
      if (!$dbMap->hasTable(DealerContactVersionTableMap::TABLE_NAME)) {
        $dbMap->addTableObject(new DealerContactVersionTableMap());
      }
    }
804354
public function createDataVersion ($strTable, $intPid, $intVersion)
	{
		$db = Database::getInstance();
		
		$objData = $db->prepare("SELECT * FROM tl_data WHERE pid=?")
					  ->execute($intPid);	
			  
		if ($objData === null)
		{
			return;
		}

		$db->prepare("INSERT INTO tl_version (pid, tstamp, version, fromTable, data) VALUES (?, ?, ?, ?, ?)")
		   ->execute($intPid, time(), $intVersion, 'tl_data', serialize($objData->fetchAllAssoc()));
	}