作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
将应用程序 Rails 5.2 更新为 6,更新添加了以下两个迁移:
# This migration comes from active_storage (originally 20190112182829)
class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0]
def up
unless column_exists?(:active_storage_blobs, :service_name)
add_column :active_storage_blobs, :service_name, :string
if configured_service = ActiveStorage::Blob.service.name
ActiveStorage::Blob.unscoped.update_all(service_name: configured_service)
end
change_column :active_storage_blobs, :service_name, :string, null: false
end
end
end
# This migration comes from active_storage (originally 20191206030411)
class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0]
def up
create_table :active_storage_variant_records do |t|
t.belongs_to :blob, null: false, index: false
t.string :variation_digest, null: false
t.index %i[ blob_id variation_digest ], name: "index_active_storage_variant_records_uniqueness", unique: true
t.foreign_key :active_storage_blobs, column: :blob_id
end
end
end
最佳答案
active_storage_blobs
表尚不存在。您需要先运行:
rails active_storage:install
active_storage_attachments
和
active_storage_blobs
.
active_storage:install
将创建。
rake db:migrate
关于ruby-on-rails - PG::UndefinedTable: 错误: 关系 "active_storage_blobs"不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59857774/
将应用程序 Rails 5.2 更新为 6,更新添加了以下两个迁移: # This migration comes from active_storage (originally 201901
我是一名优秀的程序员,十分优秀!