File tree 1 file changed +8
-1
lines changed
src/Symfony/Component/Messenger/Bridge/Doctrine/Transport
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -519,7 +519,7 @@ private function addTableToSchema(Schema $schema): void
519
519
$ table = $ schema ->createTable ($ this ->configuration ['table_name ' ]);
520
520
// add an internal option to mark that we created this & the non-namespaced table name
521
521
$ table ->addOption (self ::TABLE_OPTION_NAME , $ this ->configuration ['table_name ' ]);
522
- $ table ->addColumn ('id ' , Types::BIGINT )
522
+ $ idColumn = $ table ->addColumn ('id ' , Types::BIGINT )
523
523
->setAutoincrement (true )
524
524
->setNotnull (true );
525
525
$ table ->addColumn ('body ' , Types::TEXT )
@@ -539,6 +539,13 @@ private function addTableToSchema(Schema $schema): void
539
539
$ table ->addIndex (['queue_name ' ]);
540
540
$ table ->addIndex (['available_at ' ]);
541
541
$ table ->addIndex (['delivered_at ' ]);
542
+
543
+ // We need to create a sequence for Oracle and set the id column to get the correct nextval
544
+ if ($ this ->driverConnection ->getDatabasePlatform () instanceof OraclePlatform) {
545
+ $ idColumn ->setDefault ('seq_ ' .$ this ->configuration ['table_name ' ].'.nextval ' );
546
+
547
+ $ schema ->createSequence ('seq_ ' .$ this ->configuration ['table_name ' ]);
548
+ }
542
549
}
543
550
544
551
private function decodeEnvelopeHeaders (array $ doctrineEnvelope ): array
You can’t perform that action at this time.
0 commit comments