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
0 answers

Reuse dbal connection for db configuration in doctrine migrations

In a Symfony project, I have these two dependencies installed: "doctrine/dbal": "^3.3", "doctrine/migrations": "^3.5", I have several db connections defined in Symfony, one of them is: db.connection: class: Doctrine\DBAL\Connection …
0
votes
0 answers

Is there any way to change FK naming convention while using doctrine migration?

Currently, while using doctrine migration, FK names are dechex(crc32()) encoded column names. This is a problem when, I want to start using Doctrine migration for my existing Symfony + Doctrine application, which has really huge DB. And Index names…
Mali C.
  • 11
  • 4
0
votes
0 answers

Alter composite type that used in column as array of composite type

I have composite type in postgres composite_type(numeric(10, 2), numeric(10, 3)) Table example id(serial) comp(composite_type[]) ... ... I need to alter first attribute to numeric(12, 2). If I try to alter type manually, i have…
0
votes
1 answer

Is it possible to ignore the column when generating migrations

My project working on Symfony 4.4 and doctrine migrations bundle 3.2.1. I used the columnDefinition to write a special column: columnDefinition="VARCHAR(50) GENERATED ALWAYS AS (IF(ISNULL(`cabinet_id`), 'null', `cabinet_id`)) VIRTUAL" It works…
Starshov
  • 1
  • 5
0
votes
2 answers

Issue installing laravel-doctrine/migrations package in laravel 9

I am trying to install the migrations on a fresh install of laravel 9, however I am getting this error Problem 1 Root composer.json requires laravel-doctrine/migrations ^2.3 -> satisfiable by laravel-doctrine/migrations[2.3.0, 2.3.1,…
Felipe Castillo
  • 536
  • 8
  • 25
0
votes
0 answers

Doctrine Symfony Migration unable to correctly detect custom Tinyint type length in MySql DB

I have defined a custom doctrine tinyint type for my Symfony 6 application like so: namespace App\DoctrineTypes; use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Platforms\AbstractPlatform; /** * Class TinyIntType * * @package App\DoctrineTypes …
Bananaapple
  • 2,984
  • 2
  • 25
  • 38
0
votes
0 answers

Symfony - Doctrine: migration with multiple schema failed

Environnement: php 8.1 symfony 5.4 doctrine/dbal 3.3 doctrine/doctrine-bundle 2.7 doctrine/migrations 3.5.1 postgresql 14.4 My problem is the following; We have a database containing several schema to separate the data useful to the system and…
MarquandT
  • 11
  • 2
0
votes
1 answer

Best way to update Doctrine migrations tables

Overview I have an application that uses Doctrine migrations. The application is a software code base used to manage multiple businesses who all use the same code instance in their own unique environments. i.e. Each code base is identical other than…
HappyCoder
  • 5,985
  • 6
  • 42
  • 73
0
votes
1 answer

php bin/console doctrine:migrations:migrate SQLSTATE[HY000] [2002] Connection refused

Hello When i use php bin/console doctrine:migrations:migrate i have this error: In ExceptionConverter.php line 103: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused In Exception.php line 30: SQLSTATE[HY000]…
0
votes
2 answers

Doctrine Migrations not creating join table

I'm trying to create a join table between two entities using Doctrine ORM and the Symfony maker bundle. The two entities are User and Member. A User should be able to reference multiple Member entities, and Member entities can be referenced by…
Evan
  • 151
  • 1
  • 7
0
votes
1 answer

Symfony doctrine:execute can't find Doctrine migrations in custom folder

We've set our configuration file for doctrine migrations as the following: doctrine_migrations: migrations_paths: 'App\Migrations': "%kernel.project_dir%/src/Migrations" Our migrations command all work, for example,…
sbkevin
  • 11
  • 1
  • 3
0
votes
1 answer

symfony 5.3 php bin/console doctrine:migrations:migrate run version that already executed

I updated my symfony project to version 5.3. changed file doctrine_migrations.yaml from: doctrine_migrations: dir_name: '%kernel.project_dir%/src/Migrations' # namespace is arbitrary but should be different from App\Migrations # as…
user12660785
  • 3
  • 1
  • 3
0
votes
1 answer

Composer not generating doctrine-migrations PHP file into vendor/bin directory

I have inherited an old legacy system based off Yii 1.1 which has had multiple development teams working on it for the past 10 years so is a bit of a mess with little to no documentation. Doctrine Migrations have been used in the past and I can get…
Nicko Brooko
  • 233
  • 2
  • 11
0
votes
1 answer

Symfony 4.4. Run migrations after bundle install

I try to create a Bundle for Symfony 4.4 which must contain its own migrations. How can I create doctrine migrations and enable them in the project? Does it's possible to run doctrine:shema:update with bundle migrations after install the bundle?
Evgeniy Lenskiy
  • 329
  • 2
  • 4
  • 11
0
votes
1 answer

Escape backslashes in Doctrine Migrations

I have a table called Entity. It has a field with the namespace of an entity like this: Old\App\Email which I'm trying to rename to New\App\Email. I got this working SQL query to rename all rows in the MySQL Console. It needs 4 \ in the condition…