Bug fix for domain names with empty string instead of null. Form errors and some security fixes
This commit is contained in:
17
db/migrate/20251109011443_fix_empty_domain_patterns.rb
Normal file
17
db/migrate/20251109011443_fix_empty_domain_patterns.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
class FixEmptyDomainPatterns < ActiveRecord::Migration[8.1]
|
||||
def up
|
||||
# Convert empty string domain_patterns to NULL
|
||||
# This fixes a unique constraint issue where multiple OIDC apps
|
||||
# had empty string domain_patterns, causing uniqueness violations
|
||||
execute <<-SQL
|
||||
UPDATE applications
|
||||
SET domain_pattern = NULL
|
||||
WHERE domain_pattern = ''
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
# No need to reverse this - empty strings and NULL are functionally equivalent
|
||||
# for OIDC applications where domain_pattern is not used
|
||||
end
|
||||
end
|
||||
2
db/schema.rb
generated
2
db/schema.rb
generated
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.1].define(version: 2025_11_08_090123) do
|
||||
ActiveRecord::Schema[8.1].define(version: 2025_11_09_011443) do
|
||||
create_table "application_groups", force: :cascade do |t|
|
||||
t.integer "application_id", null: false
|
||||
t.datetime "created_at", null: false
|
||||
|
||||
Reference in New Issue
Block a user