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

Symfony 4 migrations migrate failed during Execution

my problem is I want to use the php bin/console make:migration php bin/console doctrine:migrations:migrate approach of Symfony 4 to update my database instead of using: php bin/console doctrine:schema:update --force which works fine - to say at…
Slowwie
  • 1,146
  • 2
  • 20
  • 36
3
votes
1 answer

Symfony 4 / doctrine insert initial database data

I am using symfony 4.2 and looking for a way to insert initial data to the database. What I was trying to create is something like an initial setup script that do some sql inserts (like fixtures but for the production environment as well) that can…
igi
  • 125
  • 1
  • 15
3
votes
0 answers

How to set a default value in field from another field in doctrine migration?

I have an application in symfony 1.4. I use doctrine migration to modify my database and my entity. But I want to know if it's possible when I add a column to my table to set the default value (for this new column) from another field who located in…
Arendelle
  • 117
  • 1
  • 10
3
votes
0 answers

doctrine migration generate update when no change has been done

I use doctrine migration to update my database. I've created an entity which hold and image sotre in a mediumtext : /** * Avatar of the person * @var string * * @ORM\Column(name="avatar", type="string", length=500000, nullable=true) *…
user6241056
3
votes
1 answer

Disable foreign keys in Doctrine Migrations

I'm using NDBCLUSTER engine in a MySQL DB. I've added a class for wrapping Connection and adding the engine option: namespace AppBundle\DBAL; use Doctrine\DBAL\Connection as BaseConnection; use Doctrine\DBAL\Driver; use…
Manolo
  • 24,020
  • 20
  • 85
  • 130
3
votes
0 answers

Symfony 3 doctrine migration bundle 1.2 "A non-numeric value encountered"

When i launch doctrine migration diff command from console I get this error (verbose mode): cagliostro@cagliostro:~/Projects/Pherserk/my-project$ bin/console doc:mig:diff -vvv [2016-12-04 13:30:03] php.DEBUG: mkdir(): File exists…
Michele Carino
  • 1,043
  • 2
  • 11
  • 25
3
votes
0 answers

How to use doctrine migration without console

how can I use Doctrine Migrations on the shared web hosting where is no access to SSH? I tried looking everywhere for same solution but I didn't find anything. Thanks
3
votes
1 answer

Symfony 2.7 - Doctrine migration with DateTimes stuck in permanent loop

I have scoured the internet, books and forums looking for an answer to this, and am hoping someone on here can help. I have a standard Symfony 2 project setup, using entity annotations in doctrine. The problem I have is that any of my entities that…
gristoi
  • 161
  • 2
  • 7
3
votes
0 answers

I can't install Doctrine Migrations via Composer

I've searched everywhere to fix my problem but i think my problem is a new one and there is not solution. I've added doctrine/migrations to my composer file, and when i type composer update this problem shows up: Loading composer repositories with…
3
votes
2 answers

Doctrine migrations not using specified configuration

I have been using Doctrine and Migrations in my ZF2 project for a few weeks without issue. I have been executing migrations by specifying my own configuration file: vendor/bin/doctrine-module migrations:diff…
Jon
  • 1,234
  • 2
  • 12
  • 30
3
votes
1 answer

Doctrine Migrations and Fixtures: Getting entities loaded in a migration from a fixture

I have a site that uses both Doctrine Migrations and Fixtures successfully (awesome features!), however I am having a small issue. I have added a table and a new foreign key field to that table in an existing entity. The migration populates the new…
WayneC
  • 5,569
  • 2
  • 32
  • 43
2
votes
1 answer

Why doctrine migrations ignore my index declaration?

I would like to create a table with an indexed columned to speed up searches. Here is a sample: #[ORM\Entity(repositoryClass: SettingRepository::class)] #[ORM\Table(name: '`tr_setting`', indexes: [ new ORM\Index(columns: ['code'], name:…
2
votes
2 answers

How to insert multiple rows from a data array in a Doctrine migration?

I have created an Entity and generated the migration file. Now, I want to insert some data into the table in the MySQL database when doing the migration. My up function is as follows. public function up(Schema $schema) : void { $data = array( …
Sennen Randika
  • 1,566
  • 3
  • 14
  • 34
2
votes
1 answer

Doctrine Migration Bundle: Update Error after upgrade to Version 3

There was a recent upgrade to doctrine-migrations version 3, that came as part of a vendor library upgrade, so we are kind of forced to follow now ;) We configured it like this: doctrine_migrations: migrations_paths: …
Andreas
  • 1,691
  • 1
  • 15
  • 34
2
votes
1 answer

How to prevent doctrine from creating useless migrations with DEFAULT NULL

I'd like to address question to those who use Mysql + Doctrine ORM + Doctrine migrations I have an association: /** * @var User * * @ORM\ManyToOne(targetEntity="User") * @ORM\JoinColumn(nullable=true) */ protected…
D.Samchuk
  • 1,219
  • 9
  • 9
1 2
3
9 10