]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Doctrine/DBAL/Driver/CustomPostgreSQLDriver.php
Add custom driver & schema manager for PostgreSQL 10
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Doctrine / DBAL / Driver / CustomPostgreSQLDriver.php
diff --git a/src/Wallabag/CoreBundle/Doctrine/DBAL/Driver/CustomPostgreSQLDriver.php b/src/Wallabag/CoreBundle/Doctrine/DBAL/Driver/CustomPostgreSQLDriver.php
new file mode 100644 (file)
index 0000000..eb5b203
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+
+namespace Wallabag\CoreBundle\Doctrine\DBAL\Driver;
+
+use Doctrine\DBAL\Connection;
+use Doctrine\DBAL\Driver\PDOPgSql\Driver;
+use Wallabag\CoreBundle\Doctrine\DBAL\Schema\CustomPostgreSqlSchemaManager;
+
+/**
+ * This custom driver allow to use a different schema manager
+ * So we can fix the PostgreSQL 10 problem.
+ *
+ * @see https://github.com/wallabag/wallabag/issues/3479
+ * @see https://github.com/doctrine/dbal/issues/2868
+ */
+class CustomPostgreSQLDriver extends Driver
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function getSchemaManager(Connection $conn)
+    {
+        return new CustomPostgreSqlSchemaManager($conn);
+    }
+}