[deploy] Add foreign keys between buffer_updates, rating_votes and articles (#10016)

* Add foreign keys between buffer_updates, rating_votes and articles

* Trigger Travis CI
This commit is contained in:
rhymes 2020-08-29 00:00:28 +02:00 committed by GitHub
parent 4ab5bf5255
commit 83c2e1427c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View file

@ -0,0 +1,6 @@
class AddMissingForeignKeysToModelsRelatedToArticles < ActiveRecord::Migration[6.0]
def change
add_foreign_key :buffer_updates, :articles, on_delete: :cascade, validate: false
add_foreign_key :rating_votes, :articles, on_delete: :cascade, validate: false
end
end

View file

@ -0,0 +1,6 @@
class ValidateAddMissingForeignKeysToArticlesRelatedModels < ActiveRecord::Migration[6.0]
def change
validate_foreign_key :buffer_updates, :articles
validate_foreign_key :rating_votes, :articles
end
end

View file

@ -1372,6 +1372,7 @@ ActiveRecord::Schema.define(version: 2020_08_28_032013) do
add_foreign_key "audit_logs", "users"
add_foreign_key "badge_achievements", "badges"
add_foreign_key "badge_achievements", "users"
add_foreign_key "buffer_updates", "articles", on_delete: :cascade
add_foreign_key "chat_channel_memberships", "chat_channels"
add_foreign_key "chat_channel_memberships", "users"
add_foreign_key "classified_listing_endorsements", "classified_listings"
@ -1411,6 +1412,7 @@ ActiveRecord::Schema.define(version: 2020_08_28_032013) do
add_foreign_key "polls", "articles", on_delete: :cascade
add_foreign_key "profile_fields", "profile_field_groups"
add_foreign_key "profiles", "users", on_delete: :cascade
add_foreign_key "rating_votes", "articles", on_delete: :cascade
add_foreign_key "response_templates", "users"
add_foreign_key "sponsorships", "organizations"
add_foreign_key "sponsorships", "users"