mirror of
https://github.com/moebooru/moebooru
synced 2025-08-22 01:47:48 +00:00
6 lines
193 B
Ruby
6 lines
193 B
Ruby
class AddRatioToPosts < ActiveRecord::Migration[7.2]
|
|
def change
|
|
add_column :posts, :ratio, 'numeric GENERATED ALWAYS AS (ROUND(width::numeric / GREATEST(1, height), 3)) STORED'
|
|
end
|
|
end
|