aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/db
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2018-07-19 20:43:33 -0400
committerGeorge Claghorn <george@basecamp.com>2018-07-19 20:43:33 -0400
commit2ae3a29508e2a5daab6dd3eea3e10e40df6fd945 (patch)
treefc08f206365a802df29e7d4f8115d84766ce96c1 /activestorage/db
parent3f53296f1823417d9793c4616e9134414b7be0e8 (diff)
downloadrails-2ae3a29508e2a5daab6dd3eea3e10e40df6fd945.tar.gz
rails-2ae3a29508e2a5daab6dd3eea3e10e40df6fd945.tar.bz2
rails-2ae3a29508e2a5daab6dd3eea3e10e40df6fd945.zip
Add a foreign-key constraint to the attachments table for blobs
Diffstat (limited to 'activestorage/db')
-rw-r--r--activestorage/db/migrate/20170806125915_create_active_storage_tables.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activestorage/db/migrate/20170806125915_create_active_storage_tables.rb b/activestorage/db/migrate/20170806125915_create_active_storage_tables.rb
index 9e31e3966a..cfaf01cd5e 100644
--- a/activestorage/db/migrate/20170806125915_create_active_storage_tables.rb
+++ b/activestorage/db/migrate/20170806125915_create_active_storage_tables.rb
@@ -20,6 +20,7 @@ class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
t.datetime :created_at, null: false
t.index [ :record_type, :record_id, :name, :blob_id ], name: "index_active_storage_attachments_uniqueness", unique: true
+ t.foreign_key :active_storage_blobs, column: :blob_id
end
end
end