Aug. 29th, 2014

jcfiala: (Default)

This is a blog post copied from John's Website - please feel free to join him there and post comments. He has set up openid, so you can post there with your livejournal account using your openid, which is the same as your journal url minus the http://. You can find this entry at

(If you missed it, my previous post on this topic was Using Doctrine Migrations Without the ORM.)

So my previous blog post laid down a good start on how to use Doctrine to move changes to the database, but soon I ran into a new problem - what about when you have data to change in addition to changing the structure of the database? For instance, my first try at this was putting a default row of data into a new table, or maybe putting initial data into a new column?

My first try was simple, but unfortunately not quite right, I used the addSql() command:

class Version20140828145153 extends AbstractMigration
    public function
up(Schema $schema) {
code that creates a new table>
$this->addSql("INSERT INTO <table> (this, that, theother) VALUES (...)");

Read more... )

April 2017

234567 8
910 11121314 15
161718 19202122

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 28th, 2017 08:49 am
Powered by Dreamwidth Studios