lib/pg_partition_manager.rb
# Return the date for the oldest table to keep, based on the retention setting
Return the date for the oldest table to keep, based on the retention setting
Return the date for the oldest table to keep based on the retention setting
def retention
      case @partition[:period]
      when "month"
        @start << @partition[:retain] || 6 
      when "week"
        @start - ((@partition[:retain] || 4) * 7) 
      when "day"
        @start - (@partition[:retain] || 7) 
      end
    end
def retention case @partition [ :period ] when "month" @start << @partition [ :retain ] || 6 when "week" @start - ( ( @partition [ :retain ] || 4 ) * 7 ) when "day" @start - ( @partition [ :retain ] || 7 ) end end
Return the date for the oldest table to keep, based on the retention setting
Return the date for the oldest table to keep based on the retention setting
# Default to 6 months # Default to 4 weeks # Default to 7 days