debian-mirror-gitlab/db/migrate/20200716120000_partition_audit_events.rb
2020-10-24 23:57:45 +05:30

19 lines
444 B
Ruby

# frozen_string_literal: true
class PartitionAuditEvents < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
include Gitlab::Database::PartitioningMigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME = false
disable_ddl_transaction!
def up
partition_table_by_date :audit_events, :created_at
end
def down
drop_partitioned_table_for :audit_events
end
end