Welcome Guest, Not a member yet? Register   Sign In
How to drop and rebuild tables using Doctrine without losing data?
#1

[eluser]TaylorOtwell[/eluser]
I use the following code to build my tables from my models:

Code:
Doctrine::createTablesFromModels();

I'm just starting out on a new project and it is the first time I've used Doctrine in an application. So far, since I'm just getting started and don't have any data, I've just been dropping the tables in phpMyAdmin and running the code above every time I make a change to my models. Obviously, this won't be an option in a production environment.

Does Doctrine have a method or chunk of methods I can call that will drop and rebuild the tables without losing the existing data? Perhaps by saving it off to some temporary tables first? If not, what are my other options for accomplishing the same thing?

Or, am I going the totally wrong direction in letting Doctrine generate my tables? Should I just maintain them myself and keep my relationships and columns up to date in my models?




Theme © iAndrew 2016 - Forum software by © MyBB