Skip to content
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
3 changes: 0 additions & 3 deletions src/api/.database_consistency.todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ AttribNamespaceModifiableBy:
PrimaryKeyTypeChecker:
enabled: false
AttribType:
allowed_values:
ForeignKeyCascadeChecker:
enabled: false
default_values:
ForeignKeyCascadeChecker:
enabled: false
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/attrib_allowed_value.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ class AttribAllowedValue < ApplicationRecord
#
# Foreign Keys
#
# attrib_allowed_values_ibfk_1 (attrib_type_id => attrib_types.id)
# attrib_allowed_values_ibfk_1 (attrib_type_id => attrib_types.id) ON DELETE => cascade
#
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class AddCascadeDeletionOnAttribAllowedValuesTableAttribTypeForeignKey < ActiveRecord::Migration[7.2]
def change
remove_foreign_key :attrib_allowed_values, :attrib_types
add_foreign_key :attrib_allowed_values, :attrib_types, on_delete: :cascade, name: 'attrib_allowed_values_ibfk_1'
end
end
4 changes: 2 additions & 2 deletions src/api/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.2].define(version: 2025_11_20_113549) do
ActiveRecord::Schema[7.2].define(version: 2025_11_24_111003) do
create_table "active_storage_attachments", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t|
t.string "name", null: false
t.string "record_type", null: false
Expand Down Expand Up @@ -1295,7 +1295,7 @@
add_foreign_key "assignments", "packages"
add_foreign_key "assignments", "users", column: "assignee_id"
add_foreign_key "assignments", "users", column: "assigner_id"
add_foreign_key "attrib_allowed_values", "attrib_types", name: "attrib_allowed_values_ibfk_1"
add_foreign_key "attrib_allowed_values", "attrib_types", name: "attrib_allowed_values_ibfk_1", on_delete: :cascade
add_foreign_key "attrib_default_values", "attrib_types", name: "attrib_default_values_ibfk_1"
add_foreign_key "attrib_issues", "attribs", name: "attrib_issues_ibfk_1"
add_foreign_key "attrib_issues", "issues", name: "attrib_issues_ibfk_2"
Expand Down