问题 是否在生产中创建了ar_internal_metadata表?


我想知道是否需要创建一个用于创建的迁移 ar_internal_metadata 在Rails上的生产5


9265
2017-10-28 23:33


起源



答案:


它基本上是一个安全开关,代价是复杂化和改变Rail应用程序的部署方式:

Rails 5 has added a new table ar_internal_metadata
to store environment version which is used at the
time of migrating the database.

When the first time rake db:migrate is executed
then new table stores the value production. Now
whenever we load database schema or database
structure by running rake db:schema:load or
rake db:structure:load Rails will check if Rails
environment is “production” or not. If not then
Rails will raise an exception and thus
preventing the data wipeout.

http://blog.bigbinary.com/2016/06/07/rails-5-prevents-destructive-action-on-production-db.html


15
2017-11-02 04:21



看到那个页面,错过了那个句子......虽然我不明白为什么这个信息是在博客文章而不是在Rails 5发布文档中。 - maschwenk


答案:


它基本上是一个安全开关,代价是复杂化和改变Rail应用程序的部署方式:

Rails 5 has added a new table ar_internal_metadata
to store environment version which is used at the
time of migrating the database.

When the first time rake db:migrate is executed
then new table stores the value production. Now
whenever we load database schema or database
structure by running rake db:schema:load or
rake db:structure:load Rails will check if Rails
environment is “production” or not. If not then
Rails will raise an exception and thus
preventing the data wipeout.

http://blog.bigbinary.com/2016/06/07/rails-5-prevents-destructive-action-on-production-db.html


15
2017-11-02 04:21



看到那个页面,错过了那个句子......虽然我不明白为什么这个信息是在博客文章而不是在Rails 5发布文档中。 - maschwenk