Skip to content

Commit 23a6b51

Browse files
committed
Use jsonb when using postgresql
1 parent df79c70 commit 23a6b51

File tree

5 files changed

+11
-0
lines changed

5 files changed

+11
-0
lines changed

src/Store/DoctrineDbalStore.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ public function configureSchema(Schema $schema, Connection $connection): void
337337
->setLength(255)
338338
->setNotnull(true);
339339
$table->addColumn('payload', Types::JSON)
340+
->setPlatformOption('jsonb', true)
340341
->setNotnull(true);
341342
$table->addColumn('recorded_on', Types::DATETIMETZ_IMMUTABLE)
342343
->setNotnull(true);
@@ -347,6 +348,7 @@ public function configureSchema(Schema $schema, Connection $connection): void
347348
->setNotnull(true)
348349
->setDefault(false);
349350
$table->addColumn('custom_headers', Types::JSON)
351+
->setPlatformOption('jsonb', true)
350352
->setNotnull(true);
351353

352354
$table->setPrimaryKey(['id']);

src/Store/StreamDoctrineDbalStore.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,13 +416,15 @@ public function configureSchema(Schema $schema, Connection $connection): void
416416
->setLength(255)
417417
->setNotnull(true);
418418
$table->addColumn('event_payload', Types::JSON)
419+
->setPlatformOption('jsonb', true)
419420
->setNotnull(true);
420421
$table->addColumn('recorded_on', Types::DATETIMETZ_IMMUTABLE)
421422
->setNotnull(true);
422423
$table->addColumn('archived', Types::BOOLEAN)
423424
->setNotnull(true)
424425
->setDefault(false);
425426
$table->addColumn('custom_headers', Types::JSON)
427+
->setPlatformOption('jsonb', true)
426428
->setNotnull(true);
427429

428430
$table->setPrimaryKey(['id']);

src/Subscription/Store/DoctrineSubscriptionStore.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ public function configureSchema(Schema $schema, Connection $connection): void
230230
->setLength(32)
231231
->setNotnull(false);
232232
$table->addColumn('error_context', Types::JSON)
233+
->setPlatformOption('jsonb', true)
233234
->setNotnull(false);
234235
$table->addColumn('retry_attempt', Types::INTEGER)
235236
->setNotnull(true);

tests/Unit/Store/DoctrineDbalStoreTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,6 +1310,7 @@ public function testConfigureSchema(): void
13101310
->setLength(255)
13111311
->setNotnull(true);
13121312
$table->addColumn('payload', Types::JSON)
1313+
->setPlatformOption('jsonb', true)
13131314
->setNotnull(true);
13141315
$table->addColumn('recorded_on', Types::DATETIMETZ_IMMUTABLE)
13151316
->setNotnull(true);
@@ -1320,6 +1321,7 @@ public function testConfigureSchema(): void
13201321
->setNotnull(true)
13211322
->setDefault(false);
13221323
$table->addColumn('custom_headers', Types::JSON)
1324+
->setPlatformOption('jsonb', true)
13231325
->setNotnull(true);
13241326

13251327
$table->setPrimaryKey(['id']);
@@ -1362,6 +1364,7 @@ public function testConfigureSchemaWithStringAsAggregateIdType(): void
13621364
->setLength(255)
13631365
->setNotnull(true);
13641366
$table->addColumn('payload', Types::JSON)
1367+
->setPlatformOption('jsonb', true)
13651368
->setNotnull(true);
13661369
$table->addColumn('recorded_on', Types::DATETIMETZ_IMMUTABLE)
13671370
->setNotnull(true);
@@ -1372,6 +1375,7 @@ public function testConfigureSchemaWithStringAsAggregateIdType(): void
13721375
->setNotnull(true)
13731376
->setDefault(false);
13741377
$table->addColumn('custom_headers', Types::JSON)
1378+
->setPlatformOption('jsonb', true)
13751379
->setNotnull(true);
13761380

13771381
$table->setPrimaryKey(['id']);

tests/Unit/Store/StreamDoctrineDbalStoreTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,13 +1416,15 @@ public function testConfigureSchema(): void
14161416
->setLength(255)
14171417
->setNotnull(true);
14181418
$table->addColumn('event_payload', Types::JSON)
1419+
->setPlatformOption('jsonb', true)
14191420
->setNotnull(true);
14201421
$table->addColumn('recorded_on', Types::DATETIMETZ_IMMUTABLE)
14211422
->setNotnull(true);
14221423
$table->addColumn('archived', Types::BOOLEAN)
14231424
->setNotnull(true)
14241425
->setDefault(false);
14251426
$table->addColumn('custom_headers', Types::JSON)
1427+
->setPlatformOption('jsonb', true)
14261428
->setNotnull(true);
14271429

14281430
$table->setPrimaryKey(['id']);

0 commit comments

Comments
 (0)