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
1
vote
2 answers

Doctrine Migrations Bundle - how to run migration on multiple servers at the same time?

This may not be possible at the moment but if anyone had the same problem, how did you handle it? Is it possible to run the migrations on multiple servers at the same time without running the same scripts multiple times? The problem I am having is…
pdolinaj
  • 1,087
  • 13
  • 21
1
vote
1 answer

How to run ansible command on a single server during deployment to many servers?

I'm using Ansistrano to deploy my Symfony2 application. Application uses Doctrine, oso I'm also using DoctrineMigrationsBundle. Now, my problem is that I would like to run database migration at the end of deployment process, but I want this…
pawel.kalisz
  • 1,246
  • 1
  • 18
  • 26
1
vote
0 answers

doctrine composite primary key migration

I have Doctrine entity with composite primary key in my Symfony project: /** * @ORM\Entity * @ORM\Table(name="`content_article_serie_reference`") */ class ArticleSerieReference { /** * @ORM\Id *…
1
vote
1 answer

Trigger in Doctrine Migrations

I am trying to create a rather complex trigger in a doctrine migrations class: https://github.com/2ndQuadrant/audit-trigger/blob/master/audit.sql The first impulse was just to put the whole trigger code in one big blob and add it with: public…
madflow
  • 7,718
  • 3
  • 39
  • 54
1
vote
1 answer

Segfault when running doctrine:migrations:status in prod, after switching to php7

Running: php app/console doctrine:migrations:status --env=prod gives me a Segfault, but only in prod, and only after the cache has been populated. So after clearing the cache the command runs fine. However, the second time the command is ran, I get…
Thomas K
  • 6,076
  • 5
  • 39
  • 56
1
vote
2 answers

Can't install DoctrineMigrationsBundle with Symfony3 using composer

I'm fairly new to Symfony and figured I'd follow their instructions (http://symfony.com/doc/current/book/installation.html) to install and config a new project using Symfony. I chose the "Creating Symfony Applications without the Installer" option…
David Behler
  • 179
  • 1
  • 2
  • 8
1
vote
2 answers

Doctrine Migrations not recognizing the last migration

I'm using Doctrine Migrations and all migrations worked nice until now. The last one I've created is not recognized on the staging server, but it works perfect on my local machine. The bundle recognizes as the latest migration the version…
Stev
  • 1,062
  • 11
  • 23
1
vote
1 answer

Getting error when trying to generate a migration file

I am currently working on a Symfony project and the code is inside a git repo. We work in a one story/one branch basis and don't push code until we get a code review. Before asking, I want to say that a working solution (already tried locally) is…
Mindastic
  • 4,023
  • 3
  • 19
  • 20
1
vote
2 answers

How to set field to null on doctrine migrations using addSql?

I'm updating an entity in one of my doctrine migrations with Doctrine\DBAL\Migrations\AbstractMigration::addSql($sql, array $params = array(), array $types = array()), I have to set up a column as null. I have already debugged it and I tried to set…
albert
  • 4,290
  • 1
  • 21
  • 42
1
vote
1 answer

With Symfony2 migrations changes in nullable parameter is not considered

I am using migrations in Symonfy2 (2.3). When I change a field in any of my entities from : * @ORM\JoinColumn(nullable=false) to * @ORM\JoinColumn(nullable=true) And run php app/console doctrine:migrations:diff Then no change is detected. Is this…
curuba
  • 527
  • 1
  • 10
  • 29
1
vote
1 answer

How can I update multiple databases using Doctrine migrations?

I have several databases that I need to apply migrations to. Is there a way to apply updates to all of them via Doctrine migrations?
sluther
  • 1,694
  • 20
  • 29
0
votes
0 answers

Symfony doctrine migrations --env=test errors

i have a probleme with migrations when i add '--env=test'; the 'd:m:m' command work without 'env=test' .... I create the test database using "symfony console d:d:c --env=test" all work the database is created, after i do 'symfony console d:m:m -n…
0
votes
1 answer

Doctrine Migrations with more than one databases/schemas (in Symfony project)

I have a single data connection with two schemas configured in my Symfony 6 project: Localhost - app - common Both schemas have a separate set…
Jazi
  • 6,569
  • 13
  • 60
  • 92
0
votes
0 answers

How to add a migration path from a bundle to the main application on configuration

I've come for help again. I'm developing a couple of Symfony 6.2 applications that have a bunch of code shared between them. So, I'm putting a bunch on bundles. And so far it is working, including configuring the bundle options on the main apps. The…
Yohan Leafheart
  • 860
  • 1
  • 11
  • 27
0
votes
1 answer

doctrine migrations configuration: kernel.project_dir is not interpolated

I'm trying to generate and execute migrations using doctrine/doctrine-migrations-bundle. Project specs: Project deployed in docker. Mapping configured successfully. Framework: symfony. Kernel::getProjectDir() overrided successfully. Project…