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
2
votes
1 answer

Symfony 2.1.7 and doctrine migrations bundle error

I am following this tutorial: http://tutorial.symblog.co.uk/docs/extending-the-model-blog-comments.html#doctrine-2-migrations 1) Installing Doctrine migrations bundle 1.1) - adding "doctrine/migrations": "dev-master", …
Hop hop
  • 841
  • 8
  • 21
1
vote
2 answers

--allow-empty-diff stopped working after upgrading to doctrine migrations 3

I have a deployment script that executes the migrations this way: php bin/console doctrine:migrations:diff --allow-empty-diff --env=prod php bin/console doctrine:migrations:migrate --no-interaction --allow-no-migration --env=prod And I am getting…
1
vote
1 answer

Symfony doctrine/migrations: diff is not defined

Running a blank project. I have currently this in my composer.json "require": { "php": ">=8.1", "doctrine/doctrine-bundle": "^2.7", "doctrine/migrations": "^3.5", "doctrine/orm": "^2.13", …
vukojevicf
  • 609
  • 1
  • 4
  • 22
1
vote
0 answers

Upgrading symfony project v2.8 to 3.4 - doctrine migrations error: The version "latest" couldn't be reached, there are no registered migrations

Currently when trying to run migrations I am receiving this error: [ERROR] The version "latest" couldn't be reached, there are no registered migrations. My doctrine_migrations.yaml is: doctrine_migrations: migrations_paths: …
1
vote
1 answer

How to handle migrations with multiple entity managers in DoctrineMigrationsBundle 3

On doctrine/doctrine-migrations-bundle 2.* this was relatively simple - use the --em option (and use ContainerAwareInterface to skip any migrations from a different em/connection). Now (on doctrine/doctrine-migrations-bundle 3.2.2), it seems the…
Matt Bennett
  • 120
  • 9
1
vote
1 answer

Configurate doctrine_migration_versions table in custom schema instead of public

Is there a way for the automatic doctrine_migration_versionsto be stored in a schema other than public? Right now I have a schema called inschrijving and all the entities properties are stored as tables and columns within that schema, but not the…
Ari
  • 388
  • 1
  • 5
  • 21
1
vote
2 answers

Doctrine ORM not working with the Migrations

Good Day, my friends. I want to use the doctrine ORM with the Migrations. The issue is next: I want to place the migration configuration file in the specific folder. For example: 'config/doctrine-migrations.php'. Everything working fine when I…
Mavis
  • 75
  • 8
1
vote
1 answer

How is it possible to generate doctrine migrations for both mysql, mssql and sqlite?

I would like to generate database migration scripts using doctrine migrations. One of my customers have mysql database, the other one has mssql, and we use sqlite in our dev environment. If I generate the scripts using php artisan…
Iter Ator
  • 8,226
  • 20
  • 73
  • 164
1
vote
0 answers

How to make Doctrine Migrations adding quotes to table names?

I want to use Doctrine Migrations with existing database. Table names in this database has a dash, for example: calendar-history I use doctrine:mapping:import command to create entities from database and it works well. Then I want to create first…
tnx
  • 13
  • 4
1
vote
1 answer

Map database views in Doctrine Migrations Bundle

There does not seem to be proper documentation available on how to configure and use database views with the doctrine migrations bundle. One probably is not able to map SQL statements which will end up creating/updating a database view (from the…
Jack
  • 99
  • 5
1
vote
1 answer

Fix broken migrations by "resetting" to current schema

We have taken over an old (3 years) Symfony 3.3 project using the doctrine-migrations 1.0 bundle for handling migrations. Unfortunately, the migration scripts have been broken for some time without anyone noticing, so you cannot make a fresh build…
oligofren
  • 20,744
  • 16
  • 93
  • 180
1
vote
1 answer

How to add a prefix to migrated tables in Symfony 5

I'm currently learning as I go, building a Symfony 5 application which shares a database with an existing PHP project. My question is regarding adding a prefix to all tables created by doctrine migrations. I've found a couple of references to what…
DohMoment
  • 117
  • 2
  • 8
1
vote
1 answer

Doctrine migration on Symfony for updating tables in multiple Schemas

We are migrating our Software from our own and legacy PHP framework to Symfony. Our application has different Schema for every user. So beside public Schema, we have about 2.000 user Schemas. Let's say that we have a system similar to the…
Ivan Vulović
  • 2,147
  • 6
  • 27
  • 43
1
vote
1 answer

How to prevent doctrine from generating unneeded migrations?

everyone. I use Symfony 4.2 and following database-first approach and have auto-generated entities; But then I need to do some changes in field definitions in entities but I don't want to affect the database structure. Everything works well but if I…
Ilia
  • 11
  • 2
1
vote
1 answer

How to use DoctrineMigrationsBundle with yaml file?

When I'm using Doctrine Annotation file like the example above, the command php bin/console doctrine:migrations:diffworks perfectly. #src/Entity/User.php
Alexandre Tranchant
  • 4,426
  • 4
  • 43
  • 70