public function buildPropelConfig()
    {
        $propelConfigCache = new ConfigCache(
            $this->getPropelConfigFile(),
            $this->debug
        );

        if ($propelConfigCache->isFresh()) {
            return;
        }

        $configService = new DatabaseConfigurationSource(
            Yaml::parse(file_get_contents($this->getTheliaDatabaseConfigFile())),
            $this->envParameters
        );

        $propelConfig = $configService->getPropelConnectionsConfiguration();

        $propelConfig['propel']['paths']['phpDir'] = THELIA_ROOT;
        $propelConfig['propel']['generator']['objectModel']['builders'] = [
            'object'
            => '\Thelia\Core\Propel\Generator\Builder\Om\ObjectBuilder',
            'objectstub'
            => '\Thelia\Core\Propel\Generator\Builder\Om\ExtensionObjectBuilder',
            'objectmultiextend'
            => '\Thelia\Core\Propel\Generator\Builder\Om\MultiExtendObjectBuilder',
            'query'
            => '\Thelia\Core\Propel\Generator\Builder\Om\QueryBuilder',
            'querystub'
            => '\Thelia\Core\Propel\Generator\Builder\Om\ExtensionQueryBuilder',
            'queryinheritance'
            => '\Thelia\Core\Propel\Generator\Builder\Om\QueryInheritanceBuilder',
            'queryinheritancestub'
            => '\Thelia\Core\Propel\Generator\Builder\Om\ExtensionQueryInheritanceBuilder',
            'tablemap'
            => '\Thelia\Core\Propel\Generator\Builder\Om\TableMapBuilder',
            'event'
            => '\Thelia\Core\Propel\Generator\Builder\Om\EventBuilder',
        ];

        $propelConfigCache->write(
            Yaml::dump($propelConfig),
            [new FileResource($this->getTheliaDatabaseConfigFile())]
        );
    }