mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
16 lines
439 B
Ruby
16 lines
439 B
Ruby
# frozen_string_literal: true
|
|
|
|
class AddUniqueIndexToPoints < ActiveRecord::Migration[8.0]
|
|
disable_ddl_transaction!
|
|
|
|
def up
|
|
add_index :points, %i[latitude longitude timestamp user_id],
|
|
unique: true,
|
|
name: 'unique_points_lat_long_timestamp_user_id_index',
|
|
algorithm: :concurrently
|
|
end
|
|
|
|
def down
|
|
remove_index :points, name: 'unique_points_lat_long_timestamp_user_id_index'
|
|
end
|
|
end
|