-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle missing tables #26
Conversation
if (in_array($statement->errorCode(), $this->persistenceStrategy->uniqueViolationErrorCodes())) { | ||
throw StreamExistsAlready::with($stream->streamName()); | ||
} | ||
throw new RuntimeException('Unknown error. Maybe the event streams table is not setup?'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$statement->errorInfo() provides an array with error messages. Maybe you add this strings to get a more meaningful error message?
if (in_array($statement->errorCode(), $this->persistenceStrategy->uniqueViolationErrorCodes())) { | ||
throw StreamExistsAlready::with($stream->streamName()); | ||
} | ||
throw new RuntimeException('Unknown error. Maybe the event streams table is not setup?'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$statement->errorInfo() provides an array with error messages. Maybe you add this strings to get a more meaningful error message?
$this->linkTo('foo', $event); | ||
$this->connection = TestUtil::getConnection(); | ||
$this->connection->exec(file_get_contents(__DIR__.'/../../scripts/mysql/01_event_streams_table.sql')); | ||
$this->connection->exec(file_get_contents(__DIR__.'/../../scripts/mysql/02_projections_table.sql')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lines could be added in TestUtil as "initDefaultDatabaseTables" method, since they are used on other test parts too.
@oqq updated |
fixes #24
/cc @oqq