views:

28

answers:

1

Hi all,

I have a question about database migrations files.

Do you think they should only contain database structure changes? Or is it okay to have data inside them as well? What's the best practices?

Personally I think database migrations files get ugly by putting data inside them.

+1  A: 

Where possible, try to separate the schema changes DDL (Data Definition Language) from the data changes DML (Data Manipulation Language).

Of course, there are occasions when data needs to be altered in order to perform dependent schema changes...

Mitch Wheat