dawarich/db/migrate/20250918215512_add_h3_hex_ids_to_stats.rb

13 lines
360 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class AddH3HexIdsToStats < ActiveRecord::Migration[8.0]
2025-09-19 13:55:27 -04:00
disable_ddl_transaction!
def change
add_column :stats, :h3_hex_ids, :jsonb, default: {}
2025-09-19 13:55:27 -04:00
add_index :stats, :h3_hex_ids, using: :gin,
where: "(h3_hex_ids IS NOT NULL AND h3_hex_ids != '{}'::jsonb)",
algorithm: :concurrently
end
end