hackatime/db/migrate/20260322180603_drop_raw_heartbeat_uploads.rb
Mahad Kalam 95580df3ba
Bye raw_heartbeat_uploads! (#1098)
* Drop raw_heartbeat_uploads

* oops

* Make it friendly

* finalizad

* goog

* bundlarr

* remove the newlines
2026-03-22 18:16:19 +00:00

18 lines
584 B
Ruby

class DropRawHeartbeatUploads < ActiveRecord::Migration[8.1]
def up
if foreign_key_exists?(:heartbeats, :raw_heartbeat_uploads)
remove_foreign_key :heartbeats, :raw_heartbeat_uploads
end
if index_exists?(:heartbeats, :raw_heartbeat_upload_id)
remove_index :heartbeats, :raw_heartbeat_upload_id
end
if column_exists?(:heartbeats, :raw_heartbeat_upload_id)
remove_column :heartbeats, :raw_heartbeat_upload_id
end
drop_table :raw_heartbeat_uploads, if_exists: true
end
def down
raise ActiveRecord::IrreversibleMigration
end
end