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

How can PHP doctrine/phinx migrations be deployed?

I am trying to setup a fairly simple CI/CD toolchain in TravisCI for a PHP project using composer libraries, resulting in deployment on a baremetal server via rsync. Steps are: Getting the code from the Github Repo upon git push. Run composer…
0
votes
0 answers

Symfony command calls other commands and waits for confirmation

I have setup a meta command like described here https://symfony.com/doc/3.4/console/calling_commands.html It first deletes the database, then runs a migration from scratch, and finally initializes my data. I am facing this problem since I recently …
olidem
  • 1,961
  • 2
  • 20
  • 45
0
votes
1 answer

Migrate multiple databases with Symfony migrations, without specifying db name

I have four different databases in my Symfony project. Locally those databases have their individual names so in the migrations one can tell them apart. I have prefixed each table with db_name.table in each migration so that the correct database is…
rablentain
  • 6,641
  • 13
  • 50
  • 91
0
votes
0 answers

Symfony3 Doctrine Migration with multiple databases

I got a question about doctrine migrations in relation with multiple databases. Accordingly to this question and mage as the deploying tool(but not restricted only to mage, because mage only does the manual thing automaticaly): Symfony: It's…
rebru
  • 519
  • 3
  • 10
0
votes
1 answer

Command doctrine:migrations:migrate error

I try to migrate my database, when I execute the command php app/console doctrine:migrations:migrate xxxxxxxxxx It results this message Migration xxxxxxx was executed but did not result in any SQL statements. Can Someone explain me thie message?
Mohamed Ben HEnda
  • 2,686
  • 1
  • 30
  • 44
0
votes
1 answer

Add own custom method to DoctrineMigrations

Hi I would like to create my own custom method which I could use in the migration class. I mean something like this: MigrationTraitFile.php trait MigrationTrait { public function addAdditionalTable() { ... } VersionXXX.php class…
Elly Kedward
  • 41
  • 1
  • 2
0
votes
0 answers

Symfony 3 Doctrine 2 Postgresql 9.5 Migrations trying to Create Table instead of Alter Table php7

I am using Symfony 3 and Doctrine with a Postgresql database. I generate a basic class with a few properties: namespace Dmfa\AdminBundle\Entity; use Doctrine\ORM\Mapping as ORM; /** * Event * * @ORM\Table(name="events", schema="public") *…
Dblock247
  • 6,167
  • 10
  • 44
  • 66
0
votes
2 answers

Doctrine 2 Migrations Diff Won't Generate More Than One Foreign Key per Table

I am in the process of creating a simple blog with Symfony / Doctrine 2 and running into a problem with the php app/console doctrine:migrations:diff command. Info: Postgresql Relevant tables: Post, Category, fos_user Post table should have 2…
0
votes
0 answers

String and Binary data would be truncated in Laravel db:seed

I have a problem where the generated seed for SQL Server 2012 outputs this error [Illuminate\Database\QueryException] SQLSTATE[22001]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Stri ng or binary data would be truncated. (SQL: insert…
Willy Pt
  • 1,795
  • 12
  • 20
0
votes
1 answer

Doctrine schema diff -- no objects

I am looking for a way to auto generate migrations by comparing dev to a staging environment. These migrations will then be applied automatically when pushed to staging environment Doctrine has a nice migration module but for the life of me cannot…
Alex.Barylski
  • 2,843
  • 4
  • 45
  • 68
0
votes
1 answer

Doctrine Migrations: altering a column to be nullable in production

I'm fairly new to Doctrine Migrations so apologies if this is really obvious. Updated to provide more information I have a Symfony2 entity mapping as below: /** * @ORM\Column(type="string") */ private $name; This was added to a migration and…
t j
  • 7,026
  • 12
  • 46
  • 66
0
votes
1 answer

Doctrine migration couldn`t find non-existed class

I use doc:generate-migrations-diffto generate migration classes located in lib/migrations/. You already might know, that doc:generate-migrations-... tasks create some files in tmp directory. I had some problems with it and i delete all doctrine help…
kirugan
  • 2,514
  • 2
  • 22
  • 41
0
votes
1 answer

Doctrine2 migrations inside Symfony2 throw Exception on index creation

The problem With no previous migration pending I run: app/console doctrine:migration:diff app/console doctrine:migration:migrate I got this error: ALTER TABLE session ADD CONSTRAINT FK_9955C22EA76ED395 FOREIGN KEY (user_id) REFERENCES…
AsTeR
  • 7,247
  • 14
  • 60
  • 99
0
votes
5 answers

How to install Symfony2 Bundles with Composer

I'm using Windows and I installed composer from its Windows installer. What I want to do is to install DoctrineMigrationsBundle to my project, so I added "doctrine/doctrine-migrations-bundle": "dev-master" to the composer.json file in the project…
Faery
  • 4,552
  • 10
  • 50
  • 92
-1
votes
1 answer

Migration:load list of migrations everytime I try to run migration

I just started orocommerce. I was creating a migration to add a field to the customer table. But whenever I try to dry run the migration I get a long list of migrations to run alongside the migration I created. And even after running the…
jarus
  • 1,853
  • 11
  • 44
  • 76
1 2 3
9
10