From ff4779926d2c1de34dda8bb77634dc1d946b3446 Mon Sep 17 00:00:00 2001 From: Luis Galeas Date: Tue, 17 Sep 2024 05:35:17 +0100 Subject: [PATCH] SignUp working --- .../monolith/code/src/Console/DBMigration.php | 4 ++-- .../src/Service/EventStore/SQLEventStore.php | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/application/monolith/code/src/Console/DBMigration.php b/application/monolith/code/src/Console/DBMigration.php index 388cf8d1..e98568a8 100644 --- a/application/monolith/code/src/Console/DBMigration.php +++ b/application/monolith/code/src/Console/DBMigration.php @@ -53,7 +53,7 @@ protected function execute( aggregate_version BIGINT NOT NULL, causation_id VARCHAR(56) NOT NULL, correlation_id VARCHAR(56) NOT NULL, - event_occurred_on TIMESTAMP(30) NOT NULL, + recorded_on VARCHAR(30) NOT NULL, event_name VARCHAR(255) NOT NULL, json_payload TEXT NOT NULL, json_metadata TEXT NOT NULL, @@ -62,7 +62,7 @@ protected function execute( $this->executeIndexStatementAndIgnoreExceptions("CREATE UNIQUE INDEX idx_event_aggregate_id_version ON event(aggregate_id, aggregate_version);"); $this->executeIndexStatementAndIgnoreExceptions("CREATE INDEX idx_event_causation_id ON event(causation_id);"); $this->executeIndexStatementAndIgnoreExceptions("CREATE INDEX idx_event_correlation_id ON event(correlation_id);"); - $this->executeIndexStatementAndIgnoreExceptions("CREATE INDEX idx_event_occurred_on ON event(event_occurred_on);"); + $this->executeIndexStatementAndIgnoreExceptions("CREATE INDEX idx_occurred_on ON event(recorded_on);"); $this->executeIndexStatementAndIgnoreExceptions("CREATE INDEX idx_event_name ON event(event_name);"); $this->projectionDocumentManager->getSchemaManager()->createCollections(); $this->projectionDocumentManager->getSchemaManager()->createSearchIndexes(); diff --git a/application/monolith/code/src/Service/EventStore/SQLEventStore.php b/application/monolith/code/src/Service/EventStore/SQLEventStore.php index 67ad60a5..015446e7 100644 --- a/application/monolith/code/src/Service/EventStore/SQLEventStore.php +++ b/application/monolith/code/src/Service/EventStore/SQLEventStore.php @@ -5,6 +5,7 @@ namespace Galeas\Api\Service\EventStore; use Doctrine\DBAL\Connection; +use Doctrine\DBAL\ParameterType; use Galeas\Api\Common\Aggregate\Aggregate; use Galeas\Api\Common\Event\AggregateFromEvents; use Galeas\Api\Common\Event\Event; @@ -169,15 +170,15 @@ public function save(Event $event): void 'json_metadata' => $serializedEvent->jsonMetadata(), ], [ - 'event_id' => \PDO::PARAM_STR, - 'aggregate_id' => \PDO::PARAM_STR, - 'aggregate_version' => \PDO::PARAM_INT, - 'causation_id' => \PDO::PARAM_STR, - 'correlation_id' => \PDO::PARAM_STR, - 'recorded_on' => \PDO::PARAM_STR, - 'event_name' => \PDO::PARAM_STR, - 'json_payload' => \PDO::PARAM_LOB, - 'json_metadata' => \PDO::PARAM_LOB, + 'event_id' => ParameterType::STRING, + 'aggregate_id' => ParameterType::STRING, + 'aggregate_version' => ParameterType::INTEGER, + 'causation_id' => ParameterType::STRING, + 'correlation_id' => ParameterType::STRING, + 'recorded_on' => ParameterType::STRING, + 'event_name' => ParameterType::STRING, + 'json_payload' => ParameterType::STRING, + 'json_metadata' => ParameterType::STRING, ] ); } catch (\Throwable $exception) {