Sha256: 22b0085674441e0f8bb68cfff2a24022fe8608ba111cf9627afec00de5928577

Contents?: true

Size: 413 Bytes

Versions: 5

Compression:

Stored size: 413 Bytes

Contents

class AddIncomingIpToCspReportCspReports < ActiveRecord::Migration
  def change
    add_column :csp_report_csp_reports, :incoming_ip, :string, null: true

    CspReport::CspReport.all.each do |report|
      report.incoming_ip = 'Unknown (captured prior to v0.2.0)'
      report.save!
    end

    # Removes the default value
    change_column :csp_report_csp_reports, :incoming_ip, :string, null: false
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
csp_report-1.0.1 db/migrate/20130712162922_add_incoming_ip_to_csp_report_csp_reports.rb
csp_report-1.0.0 db/migrate/20130712162922_add_incoming_ip_to_csp_report_csp_reports.rb
csp_report-0.4.0 db/migrate/20130712162922_add_incoming_ip_to_csp_report_csp_reports.rb
csp_report-0.3.0 db/migrate/20130712162922_add_incoming_ip_to_csp_report_csp_reports.rb
csp_report-0.2.0 db/migrate/20130712162922_add_incoming_ip_to_csp_report_csp_reports.rb