开发者

Should we put data in a database migration files?

开发者 https://www.devze.com 2023-01-14 06:28 出处:网络
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?

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

精彩评论

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