Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alter existing table name

How can I change table name without creating a new one?

I have a table with some records in it, if i change the table name in mapping file (xml) and run app/console doctrine:schema:update --force Doctrine leaves an old table and generates a new empty table.

like image 868
xurshid29 Avatar asked May 30 '26 10:05

xurshid29


1 Answers

Unfortunately Doctrine is not smart enough to detect such renaming because it would have a big performance impact. So instead of detecting such changes you have to rename the table manually during the update process.

To automate this process you can use Doctrine migrations for which you can find the documentation here:

Doctrine Migrations Bundle (Symfony2)

like image 108
András Avatar answered Jun 01 '26 07:06

András



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!