开发者

Should we put data in a database migration files?

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...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜