Questions tagged [doctrine-migrations]

Anything related with Doctrine migrations for Symfony and DoctrineMigrationsBundle library

Doctrine migrations for Symfony are maintained in the DoctrineMigrationsBundle.

The database migrations feature is an extension of the database abstraction layer and offers you the ability to programmatically deploy new versions of your database schema in a safe, easy and standardized way.

139 questions
0
votes
1 answer

Doctrine, In InvalidProxyDirectoryException.php line 18:

enter image description here Im using Doctrine in my custom project with PHP 7.4.6. When I`m trying to apply migration I get this error [error] Migration app\migrations\Version20210113120851 failed during Pre-Checks. Error: "Provided directory…
A J
  • 1
0
votes
0 answers

Call UserPasswordEncoderInterface encodePassword in DoctrineMigrations

I am trying to encode a password with the encodePassword function from Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface; inside my migration here is my code I tried with implements UserPasswordEncoderInterface but i did not…
Loic H
  • 328
  • 4
  • 12
0
votes
1 answer

How to fix the "key too long" error and generate the Doctrine migrations table?

I'm using / setting up the Symfony DoctrineMigrationsBundle v2.2 configured as followed: doctrine_migrations: name: 'My Migrations' migrations_paths: 'DoctrineMigrations': '%kernel.project_dir%/src/Migrations' storage: table_storage: …
automatix
  • 14,018
  • 26
  • 105
  • 230
0
votes
1 answer

Doctrine DBAL, diff command and enum type

I am working with symfony 5.1, doctrine-bundle 2.1.2 and doctrine-migrations-bundle 2.2. I am NOT working with ORM and define my own Schemas. To add Enum types, I am using the following code: abstract class EnumType extends Type { protected…
Sami Akkawi
  • 193
  • 3
  • 9
0
votes
1 answer

Doctrine Migration from string to Entity

I've an apparently simple task to perform, i have to convert several tables column from a string to a new entity (integer FOREIGN KEY) value. I have DB 10 tables with a column called "app_version" which atm are VARCHAR columns type. Since i'm going…
Diego
  • 1,610
  • 1
  • 14
  • 26
0
votes
0 answers

How to handle MariaDB System-Versioned Tables with Doctrine ORM?

I have the following table: CREATE TABLE accounts ( id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(255), amount INT ) WITH SYSTEM VERSIONING; The WITH SYSTEM VERSIONING clause initializes hidden, system-managed row_start and…
eniel.rod
  • 855
  • 8
  • 12
0
votes
1 answer

Problems when updating Symfony 4.4 DoctrineMigrationsBundle from 2 to 3

I was running Symfony 4.4.8, and I wanted to update my project. So I ran: composer update It did automatically update the DoctrineMigrationsBundle (https://packagist.org/packages/doctrine/doctrine-migrations-bundle) from 2.1.2 to 3.0.1. Composer…
0
votes
0 answers

Execute a migration only when it was not executed yet in Doctrine

I've got specific issue, when in building my project, I need to run migration only if it wasn't migrated yet. I know that I can use $this->skipIf() inside of migration, but I wanted to have some "external" way to do it, without adding code in every…
0
votes
0 answers

DoctrineMigrations with Bundle as Vendor-Package

I would like to add a database table to an existing bundle. But currently i can't find a way to integrate it into the DoctrineMigration process without a fixed coupling. I have installed "doctrine/doctrine-migrations-bundle": "^2.2" but then I get…
Hans FooBar
  • 149
  • 11
0
votes
1 answer

How to select data from old database and insert it into new one within doctrine migration?

I use 'doctrine/DoctrineORMModule' module for zend framework 3 (MVC). I have configured 'orm_default' and can configure 'orm_old' but don't know how to use 'orm_old' within migration file. I can do this within migration file: public function…
0
votes
1 answer

Make database migrations in symfony application on google app engine

I've developer version of my symfony 4 application on google app engine (flexible). My code is on github than I make cloud build where I run my tests and build/deploy my application to app engine. Because it's a developer version it will be nice to…
0
votes
1 answer

Doctrine Migrations doesn't find generated version

I am trying to fill a database with tables, but I cant migrate to it after generating it. I am using Zend Framework 3 and added doctrine-orm-module and migrations with the composer.phar file. Strangely enough generating a new version works without…
s47c953
  • 3
  • 1
  • 4
0
votes
0 answers

Why do the doctrine migrations use SQL-Statments instead of letting the entity manager handle it?

I'm currently setting up doctrine-migrations for a symfony project. I'm wondering why the auto generated migrations use direct SQL-Statements. These ones for example restrict it to mysql and INNODB-enginge (since it's my local environment). But the…
Rob
  • 1
0
votes
1 answer

How can a Symfony web app itself detect unapplied Doctrine Migrations?

The normal way of dealing with Doctrine Migrations is via the standard Commands - during development one runs the commands manually to e.g. run diffs and apply the migrations, and deployment typically involves applying them the by the same approach…
frumious
  • 1,567
  • 15
  • 25
0
votes
2 answers

Cannot execute bin/console doctrine:migrations:migrate RuntimeException /vendor/symfony/console/Helper/QuestionHelper.php:129

I am deploying my Symfony 4 app to the production environment for the first time using rsync. I then try to run the doctrine:migrations:migrate command. php -v : PHP 5.6.40 CentOS: 7.6 EasyApache4 When I execute: bin/console…