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

Script cache:clear returned with error code 1

i've tried to update Symfony 4.3 runing the command "composer update". 107 packages were updated . then in the end of the script an error appeared when runing the command "cache:clear" Executing script cache:clear [KO] [KO] Script cache:clear…
Awssam Saidi
  • 435
  • 4
  • 14
6
votes
1 answer

SQLite SQLSTATE[HY000]: General error: 8 attempt to write a readonly database

I'm using an SQLite connection and doctrine migrations for functional testing with PHPUnit. I'm making a DB migration from scratch in the setUp method: public function setUp() { parent::setUp(); @unlink(__DIR__ .…
Manolo
  • 24,020
  • 20
  • 85
  • 130
6
votes
1 answer

Doctrine migrations: create code for mysql and postgresql

I am using Doctrine ORM 2.6.1 in a Symfony 3.4.4 project. Some of my instances work on a MySQL database, some on Postgresql, and a few installations even access a MicosoftSQL server. This works fine without any special changes to my project or…
olidem
  • 1,961
  • 2
  • 20
  • 45
6
votes
1 answer

doctrine migrations bundle and postgres schema: diff does not work properly

I'm using doctrine in my Symfony project, by connecting to an already existent postgres database. The DB has several schemas, but the symfony app will use nothing but its own schema. The first Entity class I created is the following one: namespace…
Bertuz
  • 2,390
  • 3
  • 25
  • 50
6
votes
1 answer

Why default value is setting for every doctrine migration?

I use Symfony 2.7, doctrine/orm 2.5 and doctrine-bundle 1.5. In Cargo entity I have property price: /** * @var float * * @ORM\Column(name="price", type="float", options={"unsigned":true, "default":0}) */ protected…
Molarro
  • 1,005
  • 1
  • 10
  • 24
6
votes
2 answers

Can one use different database credentials for Doctrine migrations in Symfony2?

How can one configure Symfony's DoctrineMigrationsBundle to use different database authentication credentials to its DoctrineBundle—or at very least, a different DoctrineBundle connection to that used elsewhere in the app? We would like the app to…
eggyal
  • 122,705
  • 18
  • 212
  • 237
5
votes
2 answers

how set up symfony 3 doctrine migrations with multiple db?

I am struggling to have symfony/doctrine exclude db views when validating and updating schema. I first tried without doctrine migrations ( see this question) but that did not work. I found out that doctrine migrations would filter out views from…
BernardA
  • 1,391
  • 19
  • 48
5
votes
1 answer

Cannot install DoctrineMigrationsBundle via composer

Project uses Symfony 2.8.2, PHP version is 5.6 I'm trying to install DoctrineMigrationsBundle and composer fails with error: Problem 1 - doctrine/doctrine-migrations-bundle 1.0.0 requires doctrine/migrations ~1.0@dev -> satisfiable by…
Stepan Yudin
  • 470
  • 3
  • 19
5
votes
2 answers

Is the Doctrine Migrations project compatible with Doctrine MongoDB?

Is the Doctrine Migrations project compatible with Doctrine MongoDB? It isn't clear to me from searching and looking at the Doctrine Migrations project whether it is compatible with ODM solutions (e.g. MongoDB) as well as ORM solutions. If it is,…
Sean Quinn
  • 2,131
  • 1
  • 18
  • 48
5
votes
1 answer

symfony2: multiple DB connections / entity managers with doctrine migrations & schema_filter

I currently have a single database / entity manager symfony2 (2.1) app working just fine, including doctrine migrations. I am in the process of adding a second database connection + entity manager and am having trouble getting doctrine migrations to…
Josh
  • 178
  • 2
  • 8
5
votes
1 answer

Workflow for managing schema changes with Doctrine2

During development, I run Doctrine's schema:update command often to sync the database schema to my changing entity definitions. Once I'm ready to commit a feature, I want to roll up all the changes into a migration class which I can commit to git.…
Tamlyn
  • 22,122
  • 12
  • 111
  • 127
5
votes
2 answers

Symfony2 - Can doctrine:migrations:diff create DB-agnostic code instead of SQL?

Running php app/console doctrine:migrations:diff generates a new migration class as required to translate the current database schema to that specified by changes to entities. This example shows such a generated class for creating a fos_user…
Jon Cram
  • 16,609
  • 24
  • 76
  • 107
4
votes
3 answers

Doctrine table migrations_versions column length

On Symfony 5 with Doctrine Migrations 2.2.0 I want to execute a custom doctrine migration file. My entities are created with InnoDB utf8mb4_unicode_ci (default value in doctrine.yaml). When I execute bin/console doctrine:migrations:status…
TikTaZ
  • 670
  • 1
  • 11
  • 32
4
votes
2 answers

How to load Symfony2 fixtures from migration class?

We've built up a set of data fixtures to seed the database with all our reference values. We are also using the DoctrineMigrationsBundle to manage schema updates. We would like to trigger the fixture load within our initial schema migration class…
3
votes
1 answer

How to pass migrations_paths to doctrine:migrations:migrate?

It's possible to define multiple paths, where migrations are stored: doctrine_migrations.yaml doctrine_migrations: migrations_paths: 'App\Migrations': '%kernel.project_dir%/src/App' 'AnotherApp\Migrations':…
automatix
  • 14,018
  • 26
  • 105
  • 230
1
2
3
9 10