Skip to content

Commit

Permalink
Remove domains.reserved database column as unused
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur Beljajev committed Apr 3, 2019
1 parent c85ebf5 commit 1ad62bf
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 11 deletions.
1 change: 0 additions & 1 deletion app/models/domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ def registrant_change_prohibited?
self.status_notes = {} if status_notes.nil?
end

before_create -> { self.reserved = in_reserved_list?; nil }
before_save :manage_automatic_statuses
before_save :touch_always_version
def touch_always_version
Expand Down
1 change: 0 additions & 1 deletion app/models/domain_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ class DomainStatus < ActiveRecord::Base
FORCE_DELETE = 'serverForceDelete'
DELETE_CANDIDATE = 'deleteCandidate'
EXPIRED = 'expired'
RESERVED = 'reserved'

STATUSES = [
CLIENT_DELETE_PROHIBITED, SERVER_DELETE_PROHIBITED, CLIENT_HOLD, SERVER_HOLD,
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20190319133036_remove_domains_reserved.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class RemoveDomainsReserved < ActiveRecord::Migration
def change
remove_column :domains, :reserved
end
end
3 changes: 2 additions & 1 deletion db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,6 @@ CREATE TABLE public.domains (
pending_json jsonb,
force_delete_date date,
statuses character varying[],
reserved boolean DEFAULT false,
status_notes public.hstore,
statuses_before_force_delete character varying[] DEFAULT '{}'::character varying[],
upid integer,
Expand Down Expand Up @@ -4935,6 +4934,8 @@ INSERT INTO schema_migrations (version) VALUES ('20190311111718');

INSERT INTO schema_migrations (version) VALUES ('20190312211614');

INSERT INTO schema_migrations (version) VALUES ('20190319133036');

INSERT INTO schema_migrations (version) VALUES ('20190322152123');

INSERT INTO schema_migrations (version) VALUES ('20190322152529');
Expand Down
3 changes: 0 additions & 3 deletions doc/registrant-api/v1/domain.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ Content-Type: application/json
},
],
"reserved":false,
"status_notes":{
},
Expand Down Expand Up @@ -212,7 +211,6 @@ Content-Type: application/json
},
],
"reserved":false,
"status_notes":{
},
Expand Down Expand Up @@ -319,7 +317,6 @@ Content-Type: application/json
]
}
],
"reserved":false,
"status_notes":{
},
Expand Down
2 changes: 0 additions & 2 deletions doc/registrant-api/v1/registry_lock.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ Content-Type: application/json
]
}
],
"reserved":false,
"status_notes":{
},
Expand Down Expand Up @@ -240,7 +239,6 @@ Content-Type: application/json
]
}
],
"reserved":false,
"status_notes":{
},
Expand Down
1 change: 0 additions & 1 deletion doc/repp/v1/domain.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ Content-Type: application/json
"statuses": [
"ok"
],
"reserved": false,
"status_notes": {
}
}
Expand Down
1 change: 0 additions & 1 deletion lib/serializers/registrant_api/domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def to_json
force_delete_date: domain.force_delete_date,
statuses: domain.statuses,
locked_by_registrant_at: domain.locked_by_registrant_at,
reserved: domain.reserved,
status_notes: domain.status_notes,
nameservers: nameservers,
}
Expand Down
2 changes: 1 addition & 1 deletion test/lib/serializers/registrant_api/domain_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_other_fields_are_also_present
period_unit creator_str updator_str legacy_id legacy_registrar_id legacy_registrant_id
outzone_at delete_at registrant_verification_asked_at
registrant_verification_token pending_json force_delete_date statuses
locked_by_registrant_at reserved status_notes nameservers]
locked_by_registrant_at status_notes nameservers]

assert_equal(keys, @json.keys & keys)
end
Expand Down

0 comments on commit 1ad62bf

Please sign in to comment.