1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #43776 from lifeiscontent/patch-1

Update 20191206030411_create_active_storage_variant_records.rb
This commit is contained in:
Rafael Mendonça França 2021-12-08 18:24:08 -05:00 committed by GitHub
commit 6172f541d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,6 @@
class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0]
def change
unless table_exists?(:active_storage_variant_records)
# Use Active Record's configured type for primary key
create_table :active_storage_variant_records, id: primary_key_type do |t|
t.belongs_to :blob, null: false, index: false, type: blobs_primary_key_type
@ -9,6 +10,7 @@ class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0]
t.foreign_key :active_storage_blobs, column: :blob_id
end
end
end
private
def primary_key_type