From d918a4e9960044b072300428b79200b47cb46b22 Mon Sep 17 00:00:00 2001 From: ajwstevens <39310896+ajwstevens@users.noreply.github.com> Date: Thu, 28 Mar 2024 13:42:33 +0100 Subject: [PATCH] Add primary key to schema_subscriber_check Add a primary key to allow using the listener when 'sql_require_primary_key' is set. --- SchemaListener/AbstractSchemaListener.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SchemaListener/AbstractSchemaListener.php b/SchemaListener/AbstractSchemaListener.php index 04907ee9..3410fbec 100644 --- a/SchemaListener/AbstractSchemaListener.php +++ b/SchemaListener/AbstractSchemaListener.php @@ -23,7 +23,7 @@ protected function getIsSameDatabaseChecker(Connection $connection): \Closure { return static function (\Closure $exec) use ($connection): bool { $checkTable = 'schema_subscriber_check_'.bin2hex(random_bytes(7)); - $connection->executeStatement(sprintf('CREATE TABLE %s (id INTEGER NOT NULL)', $checkTable)); + $connection->executeStatement(sprintf('CREATE TABLE %s (id INTEGER PRIMARY KEY NOT NULL)', $checkTable)); try { $exec(sprintf('DROP TABLE %s', $checkTable));