diff --git a/src/Store/DoctrineDbalStore.php b/src/Store/DoctrineDbalStore.php index 28a9a977b..1acc5e6c5 100644 --- a/src/Store/DoctrineDbalStore.php +++ b/src/Store/DoctrineDbalStore.php @@ -331,6 +331,7 @@ public function configureSchema(Schema $schema, Connection $connection): void ->setLength(255) ->setNotnull(true); $table->addColumn('payload', Types::JSON) + ->setPlatformOption('jsonb', true) ->setNotnull(true); $table->addColumn('recorded_on', Types::DATETIMETZ_IMMUTABLE) ->setNotnull(true); @@ -341,6 +342,7 @@ public function configureSchema(Schema $schema, Connection $connection): void ->setNotnull(true) ->setDefault(false); $table->addColumn('custom_headers', Types::JSON) + ->setPlatformOption('jsonb', true) ->setNotnull(true); $table->setPrimaryKey(['id']); diff --git a/src/Store/StreamDoctrineDbalStore.php b/src/Store/StreamDoctrineDbalStore.php index 5e4bb3b91..6c1487046 100644 --- a/src/Store/StreamDoctrineDbalStore.php +++ b/src/Store/StreamDoctrineDbalStore.php @@ -399,6 +399,7 @@ public function configureSchema(Schema $schema, Connection $connection): void ->setLength(255) ->setNotnull(true); $table->addColumn('event_payload', Types::JSON) + ->setPlatformOption('jsonb', true) ->setNotnull(true); $table->addColumn('recorded_on', Types::DATETIMETZ_IMMUTABLE) ->setNotnull(true); @@ -409,6 +410,7 @@ public function configureSchema(Schema $schema, Connection $connection): void ->setNotnull(true) ->setDefault(false); $table->addColumn('custom_headers', Types::JSON) + ->setPlatformOption('jsonb', true) ->setNotnull(true); $table->setPrimaryKey(['id']); diff --git a/src/Subscription/Store/DoctrineSubscriptionStore.php b/src/Subscription/Store/DoctrineSubscriptionStore.php index 08cde34df..e06fb7259 100644 --- a/src/Subscription/Store/DoctrineSubscriptionStore.php +++ b/src/Subscription/Store/DoctrineSubscriptionStore.php @@ -230,6 +230,7 @@ public function configureSchema(Schema $schema, Connection $connection): void ->setLength(32) ->setNotnull(false); $table->addColumn('error_context', Types::JSON) + ->setPlatformOption('jsonb', true) ->setNotnull(false); $table->addColumn('retry_attempt', Types::INTEGER) ->setNotnull(true); diff --git a/tests/Unit/Store/DoctrineDbalStoreTest.php b/tests/Unit/Store/DoctrineDbalStoreTest.php index 3ef9d2355..c30d56022 100644 --- a/tests/Unit/Store/DoctrineDbalStoreTest.php +++ b/tests/Unit/Store/DoctrineDbalStoreTest.php @@ -1309,6 +1309,7 @@ public function testConfigureSchema(): void ->setLength(255) ->setNotnull(true); $table->addColumn('payload', Types::JSON) + ->setPlatformOption('jsonb', true) ->setNotnull(true); $table->addColumn('recorded_on', Types::DATETIMETZ_IMMUTABLE) ->setNotnull(true); @@ -1319,6 +1320,7 @@ public function testConfigureSchema(): void ->setNotnull(true) ->setDefault(false); $table->addColumn('custom_headers', Types::JSON) + ->setPlatformOption('jsonb', true) ->setNotnull(true); $table->setPrimaryKey(['id']); @@ -1361,6 +1363,7 @@ public function testConfigureSchemaWithStringAsAggregateIdType(): void ->setLength(255) ->setNotnull(true); $table->addColumn('payload', Types::JSON) + ->setPlatformOption('jsonb', true) ->setNotnull(true); $table->addColumn('recorded_on', Types::DATETIMETZ_IMMUTABLE) ->setNotnull(true); @@ -1371,6 +1374,7 @@ public function testConfigureSchemaWithStringAsAggregateIdType(): void ->setNotnull(true) ->setDefault(false); $table->addColumn('custom_headers', Types::JSON) + ->setPlatformOption('jsonb', true) ->setNotnull(true); $table->setPrimaryKey(['id']); diff --git a/tests/Unit/Store/StreamDoctrineDbalStoreTest.php b/tests/Unit/Store/StreamDoctrineDbalStoreTest.php index 00a56a491..6357eb466 100644 --- a/tests/Unit/Store/StreamDoctrineDbalStoreTest.php +++ b/tests/Unit/Store/StreamDoctrineDbalStoreTest.php @@ -1404,6 +1404,7 @@ public function testConfigureSchema(): void ->setLength(255) ->setNotnull(true); $table->addColumn('event_payload', Types::JSON) + ->setPlatformOption('jsonb', true) ->setNotnull(true); $table->addColumn('recorded_on', Types::DATETIMETZ_IMMUTABLE) ->setNotnull(true); @@ -1414,6 +1415,7 @@ public function testConfigureSchema(): void ->setNotnull(true) ->setDefault(false); $table->addColumn('custom_headers', Types::JSON) + ->setPlatformOption('jsonb', true) ->setNotnull(true); $table->setPrimaryKey(['id']);