@@ -26,6 +26,9 @@ abstract class AbstractSchemaListener
2626{
2727 abstract public function postGenerateSchema (GenerateSchemaEventArgs $ event ): void ;
2828
29+ /**
30+ * @return \Closure(\Closure(string): mixed): bool
31+ */
2932 protected function getIsSameDatabaseChecker (Connection $ connection ): \Closure
3033 {
3134 return static function (\Closure $ exec ) use ($ connection ): bool {
@@ -35,7 +38,7 @@ protected function getIsSameDatabaseChecker(Connection $connection): \Closure
3538 $ table ->addColumn ('id ' , Types::INTEGER )
3639 ->setAutoincrement (true )
3740 ->setNotnull (true );
38- $ table ->addColumn ('key ' , Types::STRING )
41+ $ table ->addColumn ('random_key ' , Types::STRING )
3942 ->setLength (14 )
4043 ->setNotNull (true )
4144 ;
@@ -51,15 +54,15 @@ protected function getIsSameDatabaseChecker(Connection $connection): \Closure
5154 } catch (DatabaseObjectExistsException ) {
5255 }
5356
54- $ connection ->executeStatement ('INSERT INTO _schema_subscriber_check (key ) VALUES (:key) ' , ['key ' => $ key ], ['key ' => Types::STRING ]);
57+ $ connection ->executeStatement ('INSERT INTO _schema_subscriber_check (random_key ) VALUES (:key) ' , ['key ' => $ key ], ['key ' => Types::STRING ]);
5558
5659 try {
57- $ exec ('DELETE FROM _schema_subscriber_check WHERE key == :key ' , [ ' key ' => $ key], [ ' key ' => Types:: STRING ] );
60+ $ exec (\sprintf ( 'DELETE FROM _schema_subscriber_check WHERE random_key = %s ' , $ connection -> getDatabasePlatform ()-> quoteStringLiteral ( $ key)) );
5861 } catch (DatabaseObjectNotFoundException |ConnectionException ) {
5962 }
6063
6164 try {
62- return !$ connection ->executeStatement ('DELETE FROM _schema_subscriber_check WHERE key = = :key ' , ['key ' => $ key ], ['key ' => Types::STRING ]);
65+ return !$ connection ->executeStatement ('DELETE FROM _schema_subscriber_check WHERE random_key = :key ' , ['key ' => $ key ], ['key ' => Types::STRING ]);
6366 } finally {
6467 if (!$ connection ->executeQuery ('SELECT count(id) FROM _schema_subscriber_check ' )->fetchOne ()) {
6568 try {
0 commit comments