mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +02:00
Added dedicated data migartion #2659
This commit is contained in:
parent
f1ebedc234
commit
b10f62f539
5 changed files with 28 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
class UpdateCertsAddCnFromCsr < ActiveRecord::Migration
|
||||
def change
|
||||
class AddCertCommonName < ActiveRecord::Migration
|
||||
def self.up
|
||||
Certificate.all.each do |x|
|
||||
if x.crt.blank? && x.csr.present?
|
||||
pc = x.parsed_csr.try(:subject).try(:to_s) || ''
|
||||
|
@ -9,4 +9,8 @@ class UpdateCertsAddCnFromCsr < ActiveRecord::Migration
|
|||
x.save
|
||||
end
|
||||
end
|
||||
|
||||
def self.down
|
||||
raise ActiveRecord::IrreversibleMigration
|
||||
end
|
||||
end
|
|
@ -1,5 +1,5 @@
|
|||
class UpdateCerts < ActiveRecord::Migration
|
||||
def change
|
||||
class AddCertMd5 < ActiveRecord::Migration
|
||||
def self.up
|
||||
Certificate.all.each do |x|
|
||||
if x.crt.present? && x.csr.present?
|
||||
x.interface = Certificate::REGISTRAR
|
||||
|
@ -21,4 +21,8 @@ class UpdateCerts < ActiveRecord::Migration
|
|||
x.save
|
||||
end
|
||||
end
|
||||
|
||||
def self.down
|
||||
raise ActiveRecord::IrreversibleMigration
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue