S
S
Sergey Khlopov2021-04-10 11:07:59
Laravel
Sergey Khlopov, 2021-04-10 11:07:59

What could be the problem with migration?

Hello, tell me please. Deployment to the server occurs through TeamCity.
And as I understand it, when performing a certain migration (without it, everything works fine), it has the following content:

Schema::table('users', function (Blueprint $table) {
  $table->string('email')->nullable()->change();
});

The following error occurs, comes to the mail:

An exception occurred while executing 'SELECT COLUMN_NAME AS Field, COLUMN_TYPE AS Type, IS_NULLABLE AS `Null`, COLUMN_KEY AS `Key`, COLUMN_DEFAULT AS `Default`, EXTRA AS Extra, COLUMN_COMMENT ASSET Comment, CHARACTER__NAME AS CharacterSet, COLLATION_NAME AS Collation FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME = 'users' ORDER BY ORDINAL_POSITION ASC':

Argument 1 passed to Doctrine\DBAL\Connection::ensureForwardCompatibilityStatement() must be an instance of Doctrine\DBAL \Driver\ResultStatement, instance of PDOStatement given, called in /var/www/TeamCity/buildAgent/work/folder/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php on line 1313

TypeError: Argument 1 passed to Doctrine\DBAL\Connection::ensureForwardCompatibilityStatement() must be an instance of Doctrine\DBAL\Driver\ResultStatement, instance of PDOStatement given, called in /var/www/TeamCity/buildAgent/work/folder/vendor /doctrine/dbal/lib/Doctrine/DBAL/Connection.php on line 1313 and defined in /var/www/TeamCity/buildAgent/work/folder/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1370

Stack trace:
#0 /var/www/TeamCity/buildAgent/work/folder/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1313): Doctrine\DBAL\Connection->ensureForwardCompatibilityStatement(Object(PDOStatement) )
#1 /var/www/TeamCity/buildAgent/work/folder/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1031): Doctrine\DBAL\Connection->executeQuery('SELECT COLUMN_N... ', Array,array)
...

I think that maybe this is a bug in TeamCity, because locally everything works fine. Added to composer.json: "doctrine/dbal": "^2.9".
PHP version 7.1, Laravel 5.2.

Please tell me what could be the problem, thanks in advance for the answer.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Khlopov, 2021-04-10
@Shlop

It seems to have solved this problem by adding the following to composer.json:
"doctrine/common": "2.7.0" and "doctrine/dbal": "2.5.13"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question