-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1902 from internetee/1900-removing-registry-lock-…
…should-not-remove-statuses-set-prior-to-setting-it implement domain statuses restore after domain locked, added test
- Loading branch information
Showing
14 changed files
with
171 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
db/data/20210406083149_transfer_domain_statuses_before_force_delete_to_json_history.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class TransferDomainStatusesBeforeForceDeleteToJsonHistory < ActiveRecord::Migration[6.0] | ||
def up | ||
domains = Domain.where.not(statuses_before_force_delete: nil) | ||
domains.each do |domain| | ||
domain.force_delete_domain_statuses_history = domain.statuses_before_force_delete | ||
domain.save | ||
end | ||
end | ||
|
||
def down | ||
# raise ActiveRecord::IrreversibleMigration | ||
end | ||
end |
13 changes: 13 additions & 0 deletions
13
db/data/20210407140317_transfer_data_from_domain_statuses_to_admin_status_history.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class TransferDataFromDomainStatusesToAdminStatusHistory < ActiveRecord::Migration[6.0] | ||
def up | ||
domains = Domain.all.select { |d| !d.locked_by_registrant?} | ||
domains.each do |domain| | ||
domain.admin_store_statuses_history = domain.statuses | ||
domain.save | ||
end | ||
end | ||
|
||
def down | ||
# raise ActiveRecord::IrreversibleMigration | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# encoding: UTF-8 | ||
DataMigrate::Data.define(version: 20201007104651) | ||
DataMigrate::Data.define(version: 20210407140317) |
6 changes: 6 additions & 0 deletions
6
db/migrate/20210405100631_add_json_statuses_history_field_to_domain.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class AddJsonStatusesHistoryFieldToDomain < ActiveRecord::Migration[6.0] | ||
def change | ||
add_column :domains, :json_statuses_history, :jsonb | ||
add_index :domains, :json_statuses_history, using: :gin | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters