Questions tagged [doctrine-migrations]

Anything related with Doctrine migrations for Symfony and DoctrineMigrationsBundle library

Filter by
Sorted by
Tagged with
0
votes
0answers
28 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, ...
0
votes
1answer
39 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 ...
0
votes
0answers
14 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
21 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
75 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
72 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
26 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
166 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
20 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
204 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:...
2
votes
1answer
293 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
28 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
90 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 ...
0
votes
0answers
154 views

Handling Multiple Databases with Symfony and Doctrine

I currently have the following layout in the database: legacy_db legacy_out application We are working on an new concept where we add an micro service for handling everything that flows into our ...
5
votes
1answer
2k 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
0answers
17 views

Why does autogenerated Doctrine Migrations does not make use of Schema-Representation?

Why is an autogenerated Doctrine Migrations created with the "getDatabasePlatform" check and plain SQL-Statements to create the schema instead of using the Doctrine\DBAL\Schema\Schema? It should be ...
0
votes
1answer
171 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 ...
4
votes
2answers
673 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
112 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 ...
1
vote
0answers
92 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
171 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 ...
1
vote
1answer
316 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 ...
1
vote
0answers
106 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
787 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 ...
2
votes
0answers
327 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
1k 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
350 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 ...
12
votes
3answers
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
319 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
592 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 ...
1
vote
1answer
673 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
196 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
229 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
321 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 { /** * @...
10
votes
3answers
5k 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
959 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
53 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
1k 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
85 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
692 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
94 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
3
votes
0answers
660 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
516 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
977 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 * * @...
1
vote
1answer
723 views

Trigger in Doctrine Migrations

I am trying to create a rather complex trigger in a doctrine migrations class: https://github.com/2ndQuadrant/audit-trigger/blob/master/audit.sql The first impulse was just to put the whole trigger ...
5
votes
1answer
2k views

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

Rename table name with Doctrine migrations

I've searched pretty much everywhere but I wasn't able to find anything. Is there a command or a procedure to change the name of a table (so inside doctrine annotation) without loosing data? ...
1
vote
1answer
240 views

Segfault when running doctrine:migrations:status in prod, after switching to php7

Running: php app/console doctrine:migrations:status --env=prod gives me a Segfault, but only in prod, and only after the cache has been populated. So after clearing the cache the command runs fine. ...
2
votes
1answer
1k views

SQLSTATE[HY000]: General error: 1025 Error on rename error when dropping foreign key in Doctrine Migration

I am seeing the error below when I run the following query inside a Doctrine migration: ALTER TABLE crmpicco_course_version DROP FOREIGN KEY FK_C060B146DE13F470 Migration 20151209153121 failed ...