You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PHP 8.0.11, Symfony 5.3., doctrine/orm 2.10., doctrine/doctrine-migrations-bundle 3.1., doctrine/dbal 3.1.
next cmd "php bin/console doctrine:migrations:migrate --no-interaction --all-or-nothing" command lead to "There is no active transaction" (In Connection.php line 136: ) error and in case I have only one migration with DDL, f.e.:
`public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
$this->connection->getDatabasePlatform()->getName() !== 'mysql',
'Migration can only be executed safely on 'mysql'.'
);
$sql = <<<SQL
CREATE TABLE scheduled_command (
id INT AUTO_INCREMENT NOT NULL,
name VARCHAR(150) NOT NULL,
command VARCHAR(200) NOT NULL,
arguments LONGTEXT DEFAULT NULL,
cron_expression VARCHAR(200) DEFAULT NULL,
last_execution DATETIME DEFAULT NULL COMMENT '(DC2Type:datetime)',
last_return_code INT DEFAULT NULL,
log_file VARCHAR(150) DEFAULT NULL,
priority INT NOT NULL,
execute_immediately TINYINT(1) NOT NULL,
disabled TINYINT(1) NOT NULL,
locked TINYINT(1) NOT NULL,
version INT DEFAULT 1 NOT NULL,
created_at DATETIME DEFAULT NULL COMMENT '(DC2Type:datetime)',
UNIQUE INDEX UNIQ_EA0DBC905E237E06 (name),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB
SQL;
As a workaround I can run cmd command without option "--all-or-nothing" and in case "all_or_nothing: false" in doctrine_migrations.yaml and in case this transaction marked as "isTransactional() -> false". But in such case I can't run migrations with option --all-or-nothing and if I have migrations with DML.
If I downgrading doctrine/dbal to 2.13.4 - everything fine and there is no such error.
P.S. Or maybe it can be related to bundle doctrine/doctrine-migrations-bundle and it should require doctrine/doctrine-bundle: ~1.0|2.1.0
The text was updated successfully, but these errors were encountered:
Bug Report
Summary
PHP 8.0.11, Symfony 5.3., doctrine/orm 2.10., doctrine/doctrine-migrations-bundle 3.1., doctrine/dbal 3.1.
next cmd "php bin/console doctrine:migrations:migrate --no-interaction --all-or-nothing" command lead to "There is no active transaction" (In Connection.php line 136: ) error and in case I have only one migration with DDL, f.e.:
`public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
$this->connection->getDatabasePlatform()->getName() !== 'mysql',
'Migration can only be executed safely on 'mysql'.'
);
CREATE TABLE scheduled_command (
id INT AUTO_INCREMENT NOT NULL,
name VARCHAR(150) NOT NULL,
command VARCHAR(200) NOT NULL,
arguments LONGTEXT DEFAULT NULL,
cron_expression VARCHAR(200) DEFAULT NULL,
last_execution DATETIME DEFAULT NULL COMMENT '(DC2Type:datetime)',
last_return_code INT DEFAULT NULL,
log_file VARCHAR(150) DEFAULT NULL,
priority INT NOT NULL,
execute_immediately TINYINT(1) NOT NULL,
disabled TINYINT(1) NOT NULL,
locked TINYINT(1) NOT NULL,
version INT DEFAULT 1 NOT NULL,
created_at DATETIME DEFAULT NULL COMMENT '(DC2Type:datetime)',
UNIQUE INDEX UNIQ_EA0DBC905E237E06 (name),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB
SQL;
As a workaround I can run cmd command without option "--all-or-nothing" and in case "all_or_nothing: false" in doctrine_migrations.yaml and in case this transaction marked as "isTransactional() -> false". But in such case I can't run migrations with option --all-or-nothing and if I have migrations with DML.
If I downgrading doctrine/dbal to 2.13.4 - everything fine and there is no such error.
P.S. Or maybe it can be related to bundle doctrine/doctrine-migrations-bundle and it should require doctrine/doctrine-bundle: ~1.0|2.1.0
The text was updated successfully, but these errors were encountered: