Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce foreign keys for mobility translations #655

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions db/migrate/20240627000000_add_foreign_keys_to_mobility.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class AddForeignKeysToMobility < ActiveRecord::Migration[7.1]
def change
add_foreign_key :subject_translations, :subjects
add_foreign_key :program_translations, :programs
add_foreign_key :division_translations, :divisions
end
end
5 changes: 4 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.1].define(version: 2024_04_22_200000) do
ActiveRecord::Schema[7.1].define(version: 2024_06_27_000000) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
enable_extension "plpgsql"
Expand Down Expand Up @@ -940,6 +940,7 @@
add_foreign_key "commontator_comments", "commontator_threads", column: "thread_id", on_update: :cascade, on_delete: :cascade
add_foreign_key "commontator_subscriptions", "commontator_threads", column: "thread_id", on_update: :cascade, on_delete: :cascade
add_foreign_key "course_self_joins", "courses"
add_foreign_key "division_translations", "divisions"
add_foreign_key "divisions", "programs"
add_foreign_key "feedbacks", "users"
add_foreign_key "imports", "media"
Expand All @@ -951,13 +952,15 @@
add_foreign_key "links", "media", column: "linked_medium_id"
add_foreign_key "medium_tag_joins", "media"
add_foreign_key "medium_tag_joins", "tags"
add_foreign_key "program_translations", "programs"
add_foreign_key "programs", "subjects"
add_foreign_key "quiz_certificates", "media", column: "quiz_id"
add_foreign_key "quiz_certificates", "users"
add_foreign_key "referrals", "items"
add_foreign_key "referrals", "media"
add_foreign_key "speaker_talk_joins", "talks"
add_foreign_key "speaker_talk_joins", "users", column: "speaker_id"
add_foreign_key "subject_translations", "subjects"
add_foreign_key "submissions", "assignments"
add_foreign_key "submissions", "tutorials"
add_foreign_key "talk_tag_joins", "tags"
Expand Down