Questions tagged [doctrine-migrations]

Anything related with Doctrine migrations for Symfony and DoctrineMigrationsBundle library

Filter by
Sorted by
Tagged with
0
votes
1answer
6 views

doctrine name convertions configuration

How can I configure doctrine to convert for example /** * @var UuidInterface * @ORM\Column(type="uuid", unique=true) */ private $locationId; to database column with name location_id, for some ...
0
votes
0answers
10 views

doctrine create migration from entities

I'm using Doctrine with vanilla PHP. And when I'm running migrations:diff command it's generating incorrect migration. My database is empty but it's generating the migration with alter statements. For ...
0
votes
0answers
60 views

How to migrate Doctrine in-memory database before PHPUnit tests?

I'm using Doctrine DBAL and want to test (with PHPUnit) my repositories using an in-memory sqlite database. Since it is in-memory I need to run the migrations before the tests. In Laravel you can do ...
0
votes
1answer
72 views

Make database migrations in symfony application on google app engine

I've developer version of my symfony 4 application on google app engine (flexible). My code is on github than I make cloud build where I run my tests and build/deploy my application to app engine. ...
0
votes
0answers
137 views

Doctrine Migrations doesn't find generated version

I am trying to fill a database with tables, but I cant migrate to it after generating it. I am using Zend Framework 3 and added doctrine-orm-module and migrations with the composer.phar file. ...
0
votes
0answers
36 views

Why do the doctrine migrations use SQL-Statments instead of letting the entity manager handle it?

I'm currently setting up doctrine-migrations for a symfony project. I'm wondering why the auto generated migrations use direct SQL-Statements. These ones for example restrict it to mysql and INNODB-...
0
votes
1answer
23 views

Doctrine, how to make 1 migration out of two you just made locally?

So I'm messing around locally and made two migrations with the second having really very minor changes on top of the first one. We agreed as a team, when working on an issue, to keep migrations ...
0
votes
0answers
32 views

How i can use doctrine migration for multiple distinct databases

I try to migrate multiple database but all tables will be present in all databases I try to create doctrine_migrations_new.yaml but that trow error of namespace db_1 tables from entity: [user, etc, ...
1
vote
1answer
110 views

Specify the directory of migrations of each entity manager

i've a multy-database project using symfony 4 and i want to make the migrations of my db1 in a folder called for ex : db1Migrations and the same for db2Migrations. i did some researchs about the ...
1
vote
0answers
47 views

Doctrine migrations order

Doctrine generates migrations with the Version{YmdHis} name formatting. Imagine that several teams work on a project. And there are two branches in a VCS: fix_tablename and feature_tablename. ...
0
votes
0answers
81 views

Doctrine migrations: cannot insert multiple commands into a prepared statement

I am trying to prepare first migration for project, that has quite big postgres database. I have dumped production DB schema, cleared it from comments and empty lines, and put whole as a text in ...
2
votes
3answers
321 views

Symfony 4: how to safely 'join' migrations together? / remove migrations in between the first and last?

I was recently tweaking around with my DB and noticed that I made 5 migrations on top of my existing 2. So 7 in total, m1, m2, ..., m7. From these 5, I only want the latest version. So I was thinking ...
0
votes
1answer
101 views

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 ...
1
vote
1answer
32 views

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 ...
0
votes
1answer
514 views

How to use doctrine migrations rollup feature on production server?

I have read: https://symfony.com/doc/master/bundles/DoctrineMigrationsBundle/index.html I'm curious about: doctrine:migrations:rollup. I know what it DOES (deletes my migrations, creates a single ...
0
votes
0answers
26 views

Problem in drawing differences with a db mapped with Doctrine in Symfony 4

First of all, I'm sorry for my bad English. Hi, I have the following problem: I have a database in postgres that I need to map, to obtain their entities. All this seems to work well. The problem ...
1
vote
1answer
554 views

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:...
3
votes
1answer
551 views

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 ...
0
votes
1answer
31 views

How can a Symfony web app itself detect unapplied Doctrine Migrations?

The normal way of dealing with Doctrine Migrations is via the standard Commands - during development one runs the commands manually to e.g. run diffs and apply the migrations, and deployment typically ...
0
votes
1answer
251 views

Cannot execute bin/console doctrine:migrations:migrate RuntimeException /vendor/symfony/console/Helper/QuestionHelper.php:129

I am deploying my Symfony 4 app to the production environment for the first time using rsync. I then try to run the doctrine:migrations:migrate command. php -v : PHP 5.6.40 CentOS: 7.6 EasyApache4 ...
7
votes
3answers
4k views

Syntax error or access violation: 1064 You have an error in your SQL In symfony

When i run comand php bin/console doctrine:migration:migrate i got this error I don't know where is come from. command line error : In AbstractMySQLDriver.php line 99: An exception occurred while ...
0
votes
1answer
273 views

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 ...
5
votes
2answers
1k views

phpstan complains about Doctrine Migrations in Symfony 3.4 with Flex project

I have a project built on Symfony 3.4 with Flex and I've added phpstan to it for static analysis. It is complaining about not finding my migration classes: Class DoctrineMigrations\...
0
votes
0answers
140 views

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 ...
2
votes
0answers
138 views

Doctrine Migrations: Multiple Schemas With Same Table Name

I am working on integrating Doctrine Migrations into an existing project and in migration files, whenever I call methods on Schema(ex. $schema->getTables()), I get this error: Executing dry run of ...
1
vote
1answer
230 views

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 <?php namespace App\Entity; use ...
3
votes
1answer
489 views

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 ...
2
votes
0answers
150 views

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 ...
1
vote
1answer
970 views

Rollback doctrine:migrations with Deployer

I have a Symfony 3 application where I use deployer to deploy my application. Also I am using Doctrine Migrations to migrate my database. I use the symfony3 recipe. When I run dep deploy, deployer ...
3
votes
0answers
348 views

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="...
2
votes
1answer
2k views

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 ...
0
votes
1answer
405 views

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 ...
11
votes
2answers
3k views

Execute next / previous migration with doctrine migrations using symfony 3

I know that I can run specific migrations using execute with up / down and version number, ie doctrine:migrations:execute YYYYMMDDHHMMSS --down My question then - is there an easier way to simply ...
0
votes
0answers
398 views

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

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

DoctrineMigrationsBundle generates same migration every time

I have an entity with field $usedMB. I'm using Doctrine2 as ORM and DoctrineMigrationsBundle for DB migrations. /** * @ORM\Entity */ class DeviceStatus { ... /** * @ORM\Column(type="...
1
vote
2answers
215 views

Doctrine Migrations Bundle - how to run migration on multiple servers at the same time?

This may not be possible at the moment but if anyone had the same problem, how did you handle it? Is it possible to run the migrations on multiple servers at the same time without running the same ...
1
vote
1answer
245 views

How to run ansible command on a single server during deployment to many servers?

I'm using Ansistrano to deploy my Symfony2 application. Application uses Doctrine, oso I'm also using DoctrineMigrationsBundle. Now, my problem is that I would like to run database migration at the ...
1
vote
0answers
369 views

doctrine composite primary key migration

I have Doctrine entity with composite primary key in my Symfony project: /** * @ORM\Entity * @ORM\Table(name="`content_article_serie_reference`") */ class ArticleSerieReference { /** * @...
11
votes
3answers
6k views

Run a database migration command when deploying a Docker container to AWS

Please bear with me. Pretty new to Docker. I'm deploying Docker containers (detached) to an AWS EC2 registry using CodeDeploy. On deploy, the following command is run after setting some environmental ...
2
votes
1answer
1k views

Doctrine Migrations with own database connection instead of using migrations-db.php file

I have been trying to use my own Doctrine\Dbal\Connection object with Doctrine Migrations, this is what I got so far, but it keeps telling me to supply a --db-configuration file, which is not what I ...
0
votes
2answers
1k views

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 ...
0
votes
1answer
60 views

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 ...
3
votes
0answers
2k views

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): [email protected]:~/Projects/Pherserk/my-project$ bin/console doc:mig:diff -vvv [2016-12-04 13:30:03] ...
1
vote
1answer
106 views

Symfony: migration of user table via browser

I have the following scenario: There's an app that can be installed by clients themselves and as not every webhoster provides console access, clients must be able to install and update the app via ...
1
vote
1answer
890 views

Generate one single migration from all migration files symfony doctrine?

My website is hosted on shared server so I cant run migration command since I dont have access to ssh. Is there any way I can generate one single migration/sql file from all migration files generated ...
3
votes
0answers
106 views

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
4
votes
0answers
722 views

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 ...
5
votes
0answers
593 views

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":...
0
votes
0answers
1k views

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 * * @...