Is ar_internal_metadata table created in production?
Asked Answered
A

1

23

I'm wondering if I need to create a migration for creating ar_internal_metadata in production on Rails 5

Accouterment answered 28/10, 2016 at 23:33 Comment(0)
C
39

It's basically a safety switch, at the expense of complicating and changing how Rails apps are deployed:

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.

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

Civilize answered 2/11, 2016 at 4:21 Comment(1)
seen that page, missed that sentence...though I don't understand why this information is on a blog post and not in the Rails 5 release documentation.Accouterment

© 2022 - 2024 — McMap. All rights reserved.