Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

Erro no comando migrations:migrate

Ao rodar o comando

vendor\bin\doctrine-migrations migrations:migrate ele retorna o WARNING! You are about to execute a migration in database "C:\Users\renat\Desktop\Programação\PHP\Projetos\Doctrine\src\Helper/../../var/data/banco.sqlite" that could result in schema changes and data loss. Are you sure you wish to continue? (yes/no) [yes]: mas ao informar Yes ou Y o seguinte erro é informado:

PHP Fatal error:  Uncaught Error: Class 'Doctrine\Migrations\Metadata\Storage\TableMetadataStorage' not found in C:\Users\renat\Desktop\Programação\PHP\Projetos\Doctrine\vendor\doctrine\migrations\lib\Doctrine\Migrations\DependencyFactory.php:338
Stack trace:
#0 C:\Users\renat\Desktop\Programação\PHP\Projetos\Doctrine\vendor\doctrine\migrations\lib\Doctrine\Migrations\DependencyFactory.php(484): Doctrine\Migrations\DependencyFactory->Doctrine\Migrations\{closure}()
#1 C:\Users\renat\Desktop\Programação\PHP\Projetos\Doctrine\vendor\doctrine\migrations\lib\Doctrine\Migrations\DependencyFactory.php(344): Doctrine\Migrations\DependencyFactory->getDependency('Doctrine\\Migrat...', Object(Closure))
#2 C:\Users\renat\Desktop\Programação\PHP\Projetos\Doctrine\vendor\doctrine\migrations\lib\Doctrine\Migrations\Tools\Console\Command\MigrateCommand.php(135): Doctrine\Migrations\DependencyFactory->getMetadataStorage()
#3 C:\Users\renat\Desktop\Programação\PHP\Projetos\Doctrine\vendor\symfony\console\Command\Command.php(255): Doc in C:\Users\renat\Desktop\Programação\PHP\Projetos\Doctrine\vendor\doctrine\migrations\lib\Doctrine\Migrations\DependencyFactory.php on line 338

Fatal error: Uncaught Error: Class 'Doctrine\Migrations\Metadata\Storage\TableMetadataStorage' not found in C:\Users\renat\Desktop\Programação\PHP\Projetos\Doctrine\vendor\doctrine\migrations\lib\Doctrine\Migrations\DependencyFactory.php:338
Stack trace:
#0 C:\Users\renat\Desktop\Programação\PHP\Projetos\Doctrine\vendor\doctrine\migrations\lib\Doctrine\Migrations\DependencyFactory.php(484): Doctrine\Migrations\DependencyFactory->Doctrine\Migrations\{closure}()
#1 C:\Users\renat\Desktop\Programação\PHP\Projetos\Doctrine\vendor\doctrine\migrations\lib\Doctrine\Migrations\DependencyFactory.php(344): Doctrine\Migrations\DependencyFactory->getDependency('Doctrine\\Migrat...', Object(Closure))
#2 C:\Users\renat\Desktop\Programação\PHP\Projetos\Doctrine\vendor\doctrine\migrations\lib\Doctrine\Migrations\Tools\Console\Command\MigrateCommand.php(135): Doctrine\Migrations\DependencyFactory->getMetadataStorage()
#3 C:\Users\renat\Desktop\Programação\PHP\Projetos\Doctrine\vendor\symfony\console\Command\Command.php(255): Doc in C:\Users\renat\Desktop\Programação\PHP\Projetos\Doctrine\vendor\doctrine\migrations\lib\Doctrine\Migrations\DependencyFactory.php on line 338
PS C:\Users\renat\Desktop\Programação\PHP\Projetos\Doctrine>

Podem ajudar? Seria por causa do caractere especial?

2 respostas

Eu alterei o nome da pasta de "Programação" para "programacao", alterei o path também e a referência dentro da IDE. Mas quando rodo o migrate

é apresentado outro erro...

In AbstractSQLiteDriver.php line 75:

  An exception occurred while executing 'CREATE TABLE Fundamentos Doctrine (version VARCHAR(1024) NOT NULL, executed_at DATETIME DEFAULT NULL, execution_time    
  INTEGER DEFAULT NULL, PRIMARY KEY(version))':                                                                                                                  

  SQLSTATE[HY000]: General error: 1 near "Doctrine": syntax error                                                                                                


In Exception.php line 18:

  SQLSTATE[HY000]: General error: 1 near "Doctrine": syntax error  


In PDOConnection.php line 52:

  SQLSTATE[HY000]: General error: 1 near "Doctrine": syntax error  
solução!

Solucionado a partir do post do Guilherme dos Santos Souza Júnior

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software