mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Enforce dominant_color length in validation (#18309)
The `add_column` `limit` parameter has no effect on a postgres `text` column. Instead we can perform the check in ActiveRecord. We never expect this condition to be hit - users cannot control this value. It's just a safety net.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
class AddDominantColorToUploads < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
add_column :uploads, :dominant_color, :text, limit: 6, null: true
|
||||
add_column :uploads, :dominant_color, :text, null: true
|
||||
add_index :uploads, :id, where: "dominant_color IS NULL"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user