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.
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...
精彩评论