diff --git a/app/interactions/domains/cancel_force_delete/restore_statuses_before_force_delete.rb b/app/interactions/domains/cancel_force_delete/restore_statuses_before_force_delete.rb index 3c2579890..f913d68b9 100644 --- a/app/interactions/domains/cancel_force_delete/restore_statuses_before_force_delete.rb +++ b/app/interactions/domains/cancel_force_delete/restore_statuses_before_force_delete.rb @@ -6,7 +6,6 @@ module Domains domain.statuses += domain.admin_store_statuses_history || [] domain.statuses.uniq! - domain.statuses_before_force_delete = nil domain.force_delete_domain_statuses_history = nil domain.admin_store_statuses_history = nil domain.save(validate: false) diff --git a/app/interactions/domains/force_delete/prepare_domain.rb b/app/interactions/domains/force_delete/prepare_domain.rb index e45f7969c..116957a87 100644 --- a/app/interactions/domains/force_delete/prepare_domain.rb +++ b/app/interactions/domains/force_delete/prepare_domain.rb @@ -7,7 +7,6 @@ module Domains def execute domain.force_delete_domain_statuses_history = domain.statuses - domain.statuses_before_force_delete = domain.statuses domain.statuses |= STATUSES_TO_SET domain.save(validate: false) end diff --git a/app/models/domain.rb b/app/models/domain.rb index 68c5bc611..d79da3bc8 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -718,7 +718,6 @@ class Domain < ApplicationRecord hash = super hash['auth_info'] = hash.delete('transfer_code') # API v1 requirement hash['valid_from'] = hash['created_at'] # API v1 requirement - hash.delete('statuses_before_force_delete') hash end diff --git a/db/migrate/20150810114746_add_statuses_backup_for_domains.rb b/db/migrate/20150810114746_add_statuses_backup_for_domains.rb index 9e9885c6c..c1f6bbfd6 100644 --- a/db/migrate/20150810114746_add_statuses_backup_for_domains.rb +++ b/db/migrate/20150810114746_add_statuses_backup_for_domains.rb @@ -1,5 +1,5 @@ class AddStatusesBackupForDomains < ActiveRecord::Migration[6.0] def change - add_column :domains, :statuses_backup, :string, array: true, default: [] + # add_column :domains, :statuses_backup, :string, array: true, default: [] end end diff --git a/db/migrate/20180422154642_rename_domains_statuses_backup_to_statuses_before_force_delete.rb b/db/migrate/20180422154642_rename_domains_statuses_backup_to_statuses_before_force_delete.rb index 97b577068..90b9321cb 100644 --- a/db/migrate/20180422154642_rename_domains_statuses_backup_to_statuses_before_force_delete.rb +++ b/db/migrate/20180422154642_rename_domains_statuses_backup_to_statuses_before_force_delete.rb @@ -1,5 +1,5 @@ class RenameDomainsStatusesBackupToStatusesBeforeForceDelete < ActiveRecord::Migration[6.0] def change - rename_column :domains, :statuses_backup, :statuses_before_force_delete + # rename_column :domains, :statuses_backup, :statuses_before_force_delete end end diff --git a/db/migrate/20220524130709_remove_statuses_before_force_delete_from_domains.rb b/db/migrate/20220524130709_remove_statuses_before_force_delete_from_domains.rb new file mode 100644 index 000000000..1a53ade83 --- /dev/null +++ b/db/migrate/20220524130709_remove_statuses_before_force_delete_from_domains.rb @@ -0,0 +1,5 @@ +class RemoveStatusesBeforeForceDeleteFromDomains < ActiveRecord::Migration[6.1] + def change + remove_column :domains, :statuses_before_force_delete + end +end diff --git a/db/structure.sql b/db/structure.sql index 66152fe27..63774c5c4 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -955,15 +955,14 @@ CREATE TABLE public.domains ( pending_json jsonb, force_delete_date date, statuses character varying[], - status_notes public.hstore, - statuses_before_force_delete character varying[] DEFAULT '{}'::character varying[], upid integer, up_date timestamp without time zone, uuid uuid DEFAULT public.gen_random_uuid() NOT NULL, locked_by_registrant_at timestamp without time zone, force_delete_start timestamp without time zone, force_delete_data public.hstore, - json_statuses_history jsonb + json_statuses_history jsonb, + status_notes public.hstore ); @@ -986,98 +985,6 @@ CREATE SEQUENCE public.domains_id_seq ALTER SEQUENCE public.domains_id_seq OWNED BY public.domains.id; --- --- Name: email_address_verifications; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.email_address_verifications ( - id bigint NOT NULL, - email public.citext NOT NULL, - verified_at timestamp without time zone, - success boolean DEFAULT false NOT NULL, - domain public.citext NOT NULL -); - - --- --- Name: email_address_verifications_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.email_address_verifications_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: email_address_verifications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.email_address_verifications_id_seq OWNED BY public.email_address_verifications.id; - - --- --- Name: email_addresses_validations; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.email_addresses_validations ( - id bigint NOT NULL, - email character varying NOT NULL, - validated_at timestamp without time zone -); - - --- --- Name: email_addresses_validations_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.email_addresses_validations_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: email_addresses_validations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.email_addresses_validations_id_seq OWNED BY public.email_addresses_validations.id; - - --- --- Name: email_addresses_verifications; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.email_addresses_verifications ( - id bigint NOT NULL, - email character varying NOT NULL, - validated_at timestamp without time zone -); - - --- --- Name: email_addresses_verifications_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.email_addresses_verifications_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: email_addresses_verifications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.email_addresses_verifications_id_seq OWNED BY public.email_addresses_verifications.id; - - -- -- Name: epp_sessions; Type: TABLE; Schema: public; Owner: - -- @@ -1196,7 +1103,6 @@ CREATE TABLE public.invoices ( buyer_vat_no character varying, issue_date date NOT NULL, e_invoice_sent_at timestamp without time zone, - payment_link character varying, CONSTRAINT invoices_due_date_is_not_before_issue_date CHECK ((due_date >= issue_date)) ); @@ -2283,74 +2189,6 @@ CREATE SEQUENCE public.payment_orders_id_seq ALTER SEQUENCE public.payment_orders_id_seq OWNED BY public.payment_orders.id; --- --- Name: pghero_query_stats; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.pghero_query_stats ( - id bigint NOT NULL, - database text, - "user" text, - query text, - query_hash bigint, - total_time double precision, - calls bigint, - captured_at timestamp without time zone -); - - --- --- Name: pghero_query_stats_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.pghero_query_stats_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: pghero_query_stats_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.pghero_query_stats_id_seq OWNED BY public.pghero_query_stats.id; - - --- --- Name: pghero_space_stats; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.pghero_space_stats ( - id bigint NOT NULL, - database text, - schema text, - relation text, - size bigint, - captured_at timestamp without time zone -); - - --- --- Name: pghero_space_stats_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.pghero_space_stats_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: pghero_space_stats_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.pghero_space_stats_id_seq OWNED BY public.pghero_space_stats.id; - - -- -- Name: prices; Type: TABLE; Schema: public; Owner: - -- @@ -2389,48 +2227,6 @@ CREATE SEQUENCE public.prices_id_seq ALTER SEQUENCE public.prices_id_seq OWNED BY public.prices.id; --- --- Name: que_jobs; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.que_jobs ( - priority smallint DEFAULT 100 NOT NULL, - run_at timestamp with time zone DEFAULT now() NOT NULL, - job_id bigint NOT NULL, - job_class text NOT NULL, - args json DEFAULT '[]'::json NOT NULL, - error_count integer DEFAULT 0 NOT NULL, - last_error text, - queue text DEFAULT ''::text NOT NULL -); - - --- --- Name: TABLE que_jobs; Type: COMMENT; Schema: public; Owner: - --- - -COMMENT ON TABLE public.que_jobs IS '3'; - - --- --- Name: que_jobs_job_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.que_jobs_job_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: que_jobs_job_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.que_jobs_job_id_seq OWNED BY public.que_jobs.job_id; - - -- -- Name: registrant_verifications; Type: TABLE; Schema: public; Owner: - -- @@ -2711,7 +2507,8 @@ CREATE TABLE public.validation_events ( validation_eventable_type character varying, validation_eventable_id bigint, created_at timestamp(6) without time zone NOT NULL, - updated_at timestamp(6) without time zone NOT NULL + updated_at timestamp(6) without time zone NOT NULL, + event_type public.validation_type ); @@ -3015,27 +2812,6 @@ ALTER TABLE ONLY public.domain_transfers ALTER COLUMN id SET DEFAULT nextval('pu ALTER TABLE ONLY public.domains ALTER COLUMN id SET DEFAULT nextval('public.domains_id_seq'::regclass); --- --- Name: email_address_verifications id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.email_address_verifications ALTER COLUMN id SET DEFAULT nextval('public.email_address_verifications_id_seq'::regclass); - - --- --- Name: email_addresses_validations id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.email_addresses_validations ALTER COLUMN id SET DEFAULT nextval('public.email_addresses_validations_id_seq'::regclass); - - --- --- Name: email_addresses_verifications id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.email_addresses_verifications ALTER COLUMN id SET DEFAULT nextval('public.email_addresses_verifications_id_seq'::regclass); - - -- -- Name: epp_sessions id; Type: DEFAULT; Schema: public; Owner: - -- @@ -3253,20 +3029,6 @@ ALTER TABLE ONLY public.notifications ALTER COLUMN id SET DEFAULT nextval('publi ALTER TABLE ONLY public.payment_orders ALTER COLUMN id SET DEFAULT nextval('public.payment_orders_id_seq'::regclass); --- --- Name: pghero_query_stats id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.pghero_query_stats ALTER COLUMN id SET DEFAULT nextval('public.pghero_query_stats_id_seq'::regclass); - - --- --- Name: pghero_space_stats id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.pghero_space_stats ALTER COLUMN id SET DEFAULT nextval('public.pghero_space_stats_id_seq'::regclass); - - -- -- Name: prices id; Type: DEFAULT; Schema: public; Owner: - -- @@ -3274,13 +3036,6 @@ ALTER TABLE ONLY public.pghero_space_stats ALTER COLUMN id SET DEFAULT nextval(' ALTER TABLE ONLY public.prices ALTER COLUMN id SET DEFAULT nextval('public.prices_id_seq'::regclass); --- --- Name: que_jobs job_id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.que_jobs ALTER COLUMN job_id SET DEFAULT nextval('public.que_jobs_job_id_seq'::regclass); - - -- -- Name: registrant_verifications id; Type: DEFAULT; Schema: public; Owner: - -- @@ -3518,30 +3273,6 @@ ALTER TABLE ONLY public.domains ADD CONSTRAINT domains_pkey PRIMARY KEY (id); --- --- Name: email_address_verifications email_address_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.email_address_verifications - ADD CONSTRAINT email_address_verifications_pkey PRIMARY KEY (id); - - --- --- Name: email_addresses_validations email_addresses_validations_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.email_addresses_validations - ADD CONSTRAINT email_addresses_validations_pkey PRIMARY KEY (id); - - --- --- Name: email_addresses_verifications email_addresses_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.email_addresses_verifications - ADD CONSTRAINT email_addresses_verifications_pkey PRIMARY KEY (id); - - -- -- Name: epp_sessions epp_sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -3790,22 +3521,6 @@ ALTER TABLE ONLY public.payment_orders ADD CONSTRAINT payment_orders_pkey PRIMARY KEY (id); --- --- Name: pghero_query_stats pghero_query_stats_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.pghero_query_stats - ADD CONSTRAINT pghero_query_stats_pkey PRIMARY KEY (id); - - --- --- Name: pghero_space_stats pghero_space_stats_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.pghero_space_stats - ADD CONSTRAINT pghero_space_stats_pkey PRIMARY KEY (id); - - -- -- Name: prices prices_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -3814,14 +3529,6 @@ ALTER TABLE ONLY public.prices ADD CONSTRAINT prices_pkey PRIMARY KEY (id); --- --- Name: que_jobs que_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.que_jobs - ADD CONSTRAINT que_jobs_pkey PRIMARY KEY (queue, priority, run_at, job_id); - - -- -- Name: registrant_verifications registrant_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -4233,13 +3940,6 @@ CREATE INDEX index_domains_on_registrar_id ON public.domains USING btree (regist CREATE INDEX index_domains_on_statuses ON public.domains USING gin (statuses); --- --- Name: index_email_address_verifications_on_domain; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_email_address_verifications_on_domain ON public.email_address_verifications USING btree (domain); - - -- -- Name: index_epp_sessions_on_updated_at; Type: INDEX; Schema: public; Owner: - -- @@ -4576,20 +4276,6 @@ CREATE INDEX index_notifications_on_registrar_id ON public.notifications USING b CREATE INDEX index_payment_orders_on_invoice_id ON public.payment_orders USING btree (invoice_id); --- --- Name: index_pghero_query_stats_on_database_and_captured_at; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_pghero_query_stats_on_database_and_captured_at ON public.pghero_query_stats USING btree (database, captured_at); - - --- --- Name: index_pghero_space_stats_on_database_and_captured_at; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_pghero_space_stats_on_database_and_captured_at ON public.pghero_space_stats USING btree (database, captured_at); - - -- -- Name: index_prices_on_zone_id; Type: INDEX; Schema: public; Owner: - -- @@ -4646,6 +4332,13 @@ CREATE INDEX index_users_on_registrar_id ON public.users USING btree (registrar_ CREATE INDEX index_validation_events_on_event_data ON public.validation_events USING gin (event_data); +-- +-- Name: index_validation_events_on_event_type; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_validation_events_on_event_type ON public.validation_events USING btree (event_type); + + -- -- Name: index_validation_events_on_validation_eventable; Type: INDEX; Schema: public; Owner: - -- @@ -5391,11 +5084,9 @@ INSERT INTO "schema_migrations" (version) VALUES ('20210708131814'), ('20210729131100'), ('20210729134625'), -('20211028122103'), -('20211028125245'), -('20211029082225'), +('20210827185249'), +('20211029073644'), ('20211124071418'), -('20211124084308'), ('20211125181033'), ('20211125184334'), ('20211126085139'), @@ -5403,14 +5094,14 @@ INSERT INTO "schema_migrations" (version) VALUES ('20220106123143'), ('20220113201642'), ('20220113220809'), -('20220124105717'), -('20220216113112'), ('20220228093211'), ('20220316140727'), +('20220406085500'), ('20220412130856'), ('20220413073315'), ('20220413084536'), ('20220413084748'), -('20220504090512'); +('20220504090512'), +('20220524130709'); diff --git a/doc/registrant-api/v1/domain.md b/doc/registrant-api/v1/domain.md index 9163a2850..f6a1705de 100644 --- a/doc/registrant-api/v1/domain.md +++ b/doc/registrant-api/v1/domain.md @@ -103,10 +103,7 @@ Content-Type: application/json "dnssec_changed_at": "2015-09-09T09:11:14.860Z", "status_notes":{ - }, - "statuses_backup":[ - - ] + } } ] ``` @@ -219,10 +216,7 @@ Content-Type: application/json "dnssec_changed_at": "2015-09-09T09:11:14.860Z", "status_notes":{ - }, - "statuses_backup":[ - - ] + } } ] ``` @@ -326,10 +320,7 @@ Content-Type: application/json "dnssec_changed_at": "2015-09-09T09:11:14.860Z", "status_notes":{ - }, - "statuses_backup":[ - - ] + } } ``` diff --git a/doc/registrant-api/v1/registry_lock.md b/doc/registrant-api/v1/registry_lock.md index 17f4c6f6e..04102420a 100644 --- a/doc/registrant-api/v1/registry_lock.md +++ b/doc/registrant-api/v1/registry_lock.md @@ -96,10 +96,7 @@ Content-Type: application/json ], "status_notes":{ - }, - "statuses_backup":[ - - ] + } } ``` @@ -235,10 +232,7 @@ Content-Type: application/json ], "status_notes":{ - }, - "statuses_backup":[ - - ] + } } ``` diff --git a/test/models/domain/force_delete_test.rb b/test/models/domain/force_delete_test.rb index 48372210b..66621f23d 100644 --- a/test/models/domain/force_delete_test.rb +++ b/test/models/domain/force_delete_test.rb @@ -128,13 +128,6 @@ class ForceDeleteTest < ActionMailer::TestCase assert_empty @domain.statuses & statuses_to_be_removed, 'Pending actions should be stopped' end - def test_scheduling_force_delete_preserves_current_statuses - @domain.statuses = %w[test1 test2] - @domain.schedule_force_delete(type: :fast_track) - @domain.reload - assert_equal %w[test1 test2], @domain.statuses_before_force_delete - end - def test_scheduling_force_delete_bypasses_validation @domain = domains(:invalid) @domain.schedule_force_delete(type: :fast_track)