From 28a54d66129b7b3991a7fc15a8896675dcd505d3 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Mon, 5 Apr 2021 15:36:24 +0300 Subject: [PATCH 01/12] implement domain statuses restore after domain locked, added test --- .../concerns/domain/registry_lockable.rb | 12 +- app/models/domain.rb | 3 + ...d_json_statuses_history_field_to_domain.rb | 6 + db/structure.sql | 1489 +++++++---------- test/models/domain/registry_lockable_test.rb | 10 + test/models/domain_test.rb | 10 + 6 files changed, 645 insertions(+), 885 deletions(-) create mode 100644 db/migrate/20210405100631_add_json_statuses_history_field_to_domain.rb diff --git a/app/models/concerns/domain/registry_lockable.rb b/app/models/concerns/domain/registry_lockable.rb index 2c0f5c0fe..a350fabff 100644 --- a/app/models/concerns/domain/registry_lockable.rb +++ b/app/models/concerns/domain/registry_lockable.rb @@ -1,6 +1,8 @@ module Domain::RegistryLockable extend ActiveSupport::Concern + # status_notes public.hstore, + LOCK_STATUSES = [DomainStatus::SERVER_UPDATE_PROHIBITED, DomainStatus::SERVER_DELETE_PROHIBITED, DomainStatus::SERVER_TRANSFER_PROHIBITED].freeze @@ -9,6 +11,12 @@ module Domain::RegistryLockable return unless registry_lockable? return if locked_by_registrant? + self.locked_domain_statuses_history = self.statuses.map do |status| + if LOCK_STATUSES.include? status + status + end + end + transaction do self.statuses |= LOCK_STATUSES self.locked_by_registrant_at = Time.zone.now @@ -36,7 +44,9 @@ module Domain::RegistryLockable transaction do LOCK_STATUSES.each do |domain_status| - statuses.delete(domain_status) + unless self.locked_domain_statuses_history.include? domain_status + statuses.delete(domain_status) + end end self.locked_by_registrant_at = nil alert_registrar_lock_changes!(lock: false) diff --git a/app/models/domain.rb b/app/models/domain.rb index 3deaf594b..0ec16cb9c 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -16,6 +16,9 @@ class Domain < ApplicationRecord attr_accessor :legal_document_id + # serialize :json_statuses_history, HashSerializer + store_accessor :json_statuses_history, :force_delete_domain_statuses_history, :locked_domain_statuses_history + alias_attribute :on_hold_time, :outzone_at alias_attribute :outzone_time, :outzone_at alias_attribute :auth_info, :transfer_code # Old attribute name; for PaperTrail diff --git a/db/migrate/20210405100631_add_json_statuses_history_field_to_domain.rb b/db/migrate/20210405100631_add_json_statuses_history_field_to_domain.rb new file mode 100644 index 000000000..de33223dc --- /dev/null +++ b/db/migrate/20210405100631_add_json_statuses_history_field_to_domain.rb @@ -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 diff --git a/db/structure.sql b/db/structure.sql index a28f7fabd..a028cd32c 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -1,29 +1,13 @@ ---- ---- PostgreSQL database dump ---- - SET statement_timeout = 0; SET lock_timeout = 0; +SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; - --- --- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: - --- - -CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; - - --- --- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: - --- - -COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; - +SET row_security = off; -- -- Name: btree_gist; Type: EXTENSION; Schema: -; Owner: - @@ -210,7 +194,7 @@ SET default_tablespace = ''; SET default_with_oids = false; -- --- Name: account_activities; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: account_activities; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.account_activities ( @@ -251,7 +235,7 @@ ALTER SEQUENCE public.account_activities_id_seq OWNED BY public.account_activiti -- --- Name: accounts; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: accounts; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.accounts ( @@ -287,7 +271,7 @@ ALTER SEQUENCE public.accounts_id_seq OWNED BY public.accounts.id; -- --- Name: actions; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: actions; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.actions ( @@ -319,7 +303,7 @@ ALTER SEQUENCE public.actions_id_seq OWNED BY public.actions.id; -- --- Name: ar_internal_metadata; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: ar_internal_metadata; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.ar_internal_metadata ( @@ -331,7 +315,7 @@ CREATE TABLE public.ar_internal_metadata ( -- --- Name: auctions; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: auctions; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.auctions ( @@ -365,7 +349,7 @@ ALTER SEQUENCE public.auctions_id_seq OWNED BY public.auctions.id; -- --- Name: bank_statements; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: bank_statements; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.bank_statements ( @@ -400,7 +384,7 @@ ALTER SEQUENCE public.bank_statements_id_seq OWNED BY public.bank_statements.id; -- --- Name: bank_transactions; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: bank_transactions; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.bank_transactions ( @@ -444,7 +428,7 @@ ALTER SEQUENCE public.bank_transactions_id_seq OWNED BY public.bank_transactions -- --- Name: blocked_domains; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: blocked_domains; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.blocked_domains ( @@ -477,7 +461,7 @@ ALTER SEQUENCE public.blocked_domains_id_seq OWNED BY public.blocked_domains.id; -- --- Name: bounced_mail_addresses; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: bounced_mail_addresses; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.bounced_mail_addresses ( @@ -514,7 +498,7 @@ ALTER SEQUENCE public.bounced_mail_addresses_id_seq OWNED BY public.bounced_mail -- --- Name: certificates; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: certificates; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.certificates ( @@ -553,7 +537,7 @@ ALTER SEQUENCE public.certificates_id_seq OWNED BY public.certificates.id; -- --- Name: contacts; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: contacts; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.contacts ( @@ -611,7 +595,42 @@ ALTER SEQUENCE public.contacts_id_seq OWNED BY public.contacts.id; -- --- Name: data_migrations; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: csync_records; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.csync_records ( + id bigint NOT NULL, + domain_id bigint NOT NULL, + cdnskey character varying NOT NULL, + action character varying NOT NULL, + times_scanned integer DEFAULT 0 NOT NULL, + last_scan timestamp without time zone NOT NULL, + created_at timestamp(6) without time zone NOT NULL, + updated_at timestamp(6) without time zone NOT NULL +); + + +-- +-- Name: csync_records_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.csync_records_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: csync_records_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.csync_records_id_seq OWNED BY public.csync_records.id; + + +-- +-- Name: data_migrations; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.data_migrations ( @@ -620,7 +639,7 @@ CREATE TABLE public.data_migrations ( -- --- Name: directos; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: directos; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.directos ( @@ -655,7 +674,7 @@ ALTER SEQUENCE public.directos_id_seq OWNED BY public.directos.id; -- --- Name: disputes; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: disputes; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.disputes ( @@ -692,7 +711,7 @@ ALTER SEQUENCE public.disputes_id_seq OWNED BY public.disputes.id; -- --- Name: dnskeys; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: dnskeys; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.dnskeys ( @@ -733,7 +752,7 @@ ALTER SEQUENCE public.dnskeys_id_seq OWNED BY public.dnskeys.id; -- --- Name: domain_contacts; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: domain_contacts; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_contacts ( @@ -771,7 +790,7 @@ ALTER SEQUENCE public.domain_contacts_id_seq OWNED BY public.domain_contacts.id; -- --- Name: domain_transfers; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: domain_transfers; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_transfers ( @@ -808,7 +827,7 @@ ALTER SEQUENCE public.domain_transfers_id_seq OWNED BY public.domain_transfers.i -- --- Name: domains; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: domains; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domains ( @@ -843,7 +862,8 @@ CREATE TABLE public.domains ( 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 + force_delete_data public.hstore, + json_statuses_history jsonb ); @@ -867,7 +887,7 @@ ALTER SEQUENCE public.domains_id_seq OWNED BY public.domains.id; -- --- Name: email_address_verifications; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: email_address_verifications; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.email_address_verifications ( @@ -899,7 +919,7 @@ ALTER SEQUENCE public.email_address_verifications_id_seq OWNED BY public.email_a -- --- Name: email_addresses_validations; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: email_addresses_validations; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.email_addresses_validations ( @@ -929,7 +949,7 @@ ALTER SEQUENCE public.email_addresses_validations_id_seq OWNED BY public.email_a -- --- Name: email_addresses_verifications; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: email_addresses_verifications; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.email_addresses_verifications ( @@ -959,7 +979,7 @@ ALTER SEQUENCE public.email_addresses_verifications_id_seq OWNED BY public.email -- --- Name: epp_sessions; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: epp_sessions; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.epp_sessions ( @@ -991,7 +1011,7 @@ ALTER SEQUENCE public.epp_sessions_id_seq OWNED BY public.epp_sessions.id; -- --- Name: invoice_items; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: invoice_items; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.invoice_items ( @@ -1029,7 +1049,7 @@ ALTER SEQUENCE public.invoice_items_id_seq OWNED BY public.invoice_items.id; -- --- Name: invoices; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: invoices; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.invoices ( @@ -1100,7 +1120,7 @@ ALTER SEQUENCE public.invoices_id_seq OWNED BY public.invoices.id; -- --- Name: legal_documents; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: legal_documents; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.legal_documents ( @@ -1135,7 +1155,7 @@ ALTER SEQUENCE public.legal_documents_id_seq OWNED BY public.legal_documents.id; -- --- Name: log_account_activities; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_account_activities; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_account_activities ( @@ -1173,7 +1193,7 @@ ALTER SEQUENCE public.log_account_activities_id_seq OWNED BY public.log_account_ -- --- Name: log_accounts; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_accounts; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_accounts ( @@ -1211,7 +1231,7 @@ ALTER SEQUENCE public.log_accounts_id_seq OWNED BY public.log_accounts.id; -- --- Name: log_actions; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_actions; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_actions ( @@ -1249,7 +1269,7 @@ ALTER SEQUENCE public.log_actions_id_seq OWNED BY public.log_actions.id; -- --- Name: log_bank_statements; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_bank_statements; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_bank_statements ( @@ -1287,7 +1307,7 @@ ALTER SEQUENCE public.log_bank_statements_id_seq OWNED BY public.log_bank_statem -- --- Name: log_bank_transactions; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_bank_transactions; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_bank_transactions ( @@ -1325,7 +1345,7 @@ ALTER SEQUENCE public.log_bank_transactions_id_seq OWNED BY public.log_bank_tran -- --- Name: log_blocked_domains; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_blocked_domains; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_blocked_domains ( @@ -1363,7 +1383,7 @@ ALTER SEQUENCE public.log_blocked_domains_id_seq OWNED BY public.log_blocked_dom -- --- Name: log_certificates; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_certificates; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_certificates ( @@ -1401,7 +1421,7 @@ ALTER SEQUENCE public.log_certificates_id_seq OWNED BY public.log_certificates.i -- --- Name: log_contacts; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_contacts; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_contacts ( @@ -1440,7 +1460,7 @@ ALTER SEQUENCE public.log_contacts_id_seq OWNED BY public.log_contacts.id; -- --- Name: log_dnskeys; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_dnskeys; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_dnskeys ( @@ -1478,7 +1498,7 @@ ALTER SEQUENCE public.log_dnskeys_id_seq OWNED BY public.log_dnskeys.id; -- --- Name: log_domain_contacts; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_domain_contacts; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_domain_contacts ( @@ -1516,7 +1536,7 @@ ALTER SEQUENCE public.log_domain_contacts_id_seq OWNED BY public.log_domain_cont -- --- Name: log_domains; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_domains; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_domains ( @@ -1554,7 +1574,7 @@ ALTER SEQUENCE public.log_domains_id_seq OWNED BY public.log_domains.id; -- --- Name: log_invoice_items; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_invoice_items; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_invoice_items ( @@ -1592,7 +1612,7 @@ ALTER SEQUENCE public.log_invoice_items_id_seq OWNED BY public.log_invoice_items -- --- Name: log_invoices; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_invoices; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_invoices ( @@ -1630,7 +1650,7 @@ ALTER SEQUENCE public.log_invoices_id_seq OWNED BY public.log_invoices.id; -- --- Name: log_nameservers; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_nameservers; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_nameservers ( @@ -1668,7 +1688,7 @@ ALTER SEQUENCE public.log_nameservers_id_seq OWNED BY public.log_nameservers.id; -- --- Name: log_notifications; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_notifications; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_notifications ( @@ -1706,7 +1726,7 @@ ALTER SEQUENCE public.log_notifications_id_seq OWNED BY public.log_notifications -- --- Name: log_payment_orders; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_payment_orders; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_payment_orders ( @@ -1819,7 +1839,7 @@ ALTER SEQUENCE public.log_registrant_verifications_id_seq OWNED BY public.log_re -- --- Name: log_registrars; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_registrars; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_registrars ( @@ -1857,7 +1877,7 @@ ALTER SEQUENCE public.log_registrars_id_seq OWNED BY public.log_registrars.id; -- --- Name: log_reserved_domains; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_reserved_domains; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_reserved_domains ( @@ -1895,7 +1915,7 @@ ALTER SEQUENCE public.log_reserved_domains_id_seq OWNED BY public.log_reserved_d -- --- Name: log_setting_entries; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_setting_entries; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_setting_entries ( @@ -1933,7 +1953,7 @@ ALTER SEQUENCE public.log_setting_entries_id_seq OWNED BY public.log_setting_ent -- --- Name: log_settings; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_settings; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_settings ( @@ -1971,7 +1991,7 @@ ALTER SEQUENCE public.log_settings_id_seq OWNED BY public.log_settings.id; -- --- Name: log_users; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_users; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_users ( @@ -1988,40 +2008,6 @@ CREATE TABLE public.log_users ( uuid character varying ); --- --- Name: csync_records; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.csync_records ( - id bigint NOT NULL, - domain_id bigint NOT NULL, - cdnskey character varying NOT NULL, - action character varying NOT NULL, - times_scanned integer DEFAULT 0 NOT NULL, - last_scan timestamp without time zone NOT NULL, - created_at timestamp(6) without time zone NOT NULL, - updated_at timestamp(6) without time zone NOT NULL -); - - --- --- Name: csync_records_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.csync_records_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: csync_records_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.csync_records_id_seq OWNED BY public.csync_records.id; - -- -- Name: log_users_id_seq; Type: SEQUENCE; Schema: public; Owner: - @@ -2043,7 +2029,7 @@ ALTER SEQUENCE public.log_users_id_seq OWNED BY public.log_users.id; -- --- Name: log_white_ips; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_white_ips; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_white_ips ( @@ -2081,7 +2067,7 @@ ALTER SEQUENCE public.log_white_ips_id_seq OWNED BY public.log_white_ips.id; -- --- Name: nameservers; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: nameservers; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.nameservers ( @@ -2119,7 +2105,7 @@ ALTER SEQUENCE public.nameservers_id_seq OWNED BY public.nameservers.id; -- --- Name: notifications; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: notifications; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.notifications ( @@ -2157,7 +2143,7 @@ ALTER SEQUENCE public.notifications_id_seq OWNED BY public.notifications.id; -- --- Name: payment_orders; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: payment_orders; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.payment_orders ( @@ -2194,7 +2180,7 @@ ALTER SEQUENCE public.payment_orders_id_seq OWNED BY public.payment_orders.id; -- --- Name: prices; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: prices; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.prices ( @@ -2232,7 +2218,7 @@ ALTER SEQUENCE public.prices_id_seq OWNED BY public.prices.id; -- --- Name: que_jobs; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: que_jobs; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.que_jobs ( @@ -2274,7 +2260,7 @@ ALTER SEQUENCE public.que_jobs_job_id_seq OWNED BY public.que_jobs.job_id; -- --- Name: registrant_verifications; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: registrant_verifications; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.registrant_verifications ( @@ -2285,12 +2271,6 @@ CREATE TABLE public.registrant_verifications ( action character varying NOT NULL, domain_id integer NOT NULL, action_type character varying NOT NULL, - creator_id integer, - updater_id integer, - session character varying, - children json, - ident_updated_at timestamp without time zone, - uuid character varying, creator_str character varying, updator_str character varying ); @@ -2316,7 +2296,7 @@ ALTER SEQUENCE public.registrant_verifications_id_seq OWNED BY public.registrant -- --- Name: registrars; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: registrars; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.registrars ( @@ -2371,7 +2351,7 @@ ALTER SEQUENCE public.registrars_id_seq OWNED BY public.registrars.id; -- --- Name: reserved_domains; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: reserved_domains; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.reserved_domains ( @@ -2406,7 +2386,7 @@ ALTER SEQUENCE public.reserved_domains_id_seq OWNED BY public.reserved_domains.i -- --- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.schema_migrations ( @@ -2415,7 +2395,7 @@ CREATE TABLE public.schema_migrations ( -- --- Name: setting_entries; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: setting_entries; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.setting_entries ( @@ -2451,7 +2431,7 @@ ALTER SEQUENCE public.setting_entries_id_seq OWNED BY public.setting_entries.id; -- --- Name: settings; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: settings; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.settings ( @@ -2487,7 +2467,7 @@ ALTER SEQUENCE public.settings_id_seq OWNED BY public.settings.id; -- --- Name: users; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: users; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.users ( @@ -2539,7 +2519,7 @@ ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id; -- --- Name: versions; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: versions; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.versions ( @@ -2574,7 +2554,7 @@ ALTER SEQUENCE public.versions_id_seq OWNED BY public.versions.id; -- --- Name: white_ips; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: white_ips; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.white_ips ( @@ -2610,7 +2590,7 @@ ALTER SEQUENCE public.white_ips_id_seq OWNED BY public.white_ips.id; -- --- Name: whois_records; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: whois_records; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.whois_records ( @@ -2645,7 +2625,7 @@ ALTER SEQUENCE public.whois_records_id_seq OWNED BY public.whois_records.id; -- --- Name: zones; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: zones; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.zones ( @@ -2688,460 +2668,154 @@ ALTER SEQUENCE public.zones_id_seq OWNED BY public.zones.id; -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: account_activities id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.account_activities ALTER COLUMN id SET DEFAULT nextval('public.account_activities_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: accounts id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.accounts ALTER COLUMN id SET DEFAULT nextval('public.accounts_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: actions id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.actions ALTER COLUMN id SET DEFAULT nextval('public.actions_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: auctions id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.auctions ALTER COLUMN id SET DEFAULT nextval('public.auctions_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: bank_statements id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.bank_statements ALTER COLUMN id SET DEFAULT nextval('public.bank_statements_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: bank_transactions id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.bank_transactions ALTER COLUMN id SET DEFAULT nextval('public.bank_transactions_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: blocked_domains id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.blocked_domains ALTER COLUMN id SET DEFAULT nextval('public.blocked_domains_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: bounced_mail_addresses id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.bounced_mail_addresses ALTER COLUMN id SET DEFAULT nextval('public.bounced_mail_addresses_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: certificates id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.certificates ALTER COLUMN id SET DEFAULT nextval('public.certificates_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: contacts id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.contacts ALTER COLUMN id SET DEFAULT nextval('public.contacts_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: csync_records id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.csync_records ALTER COLUMN id SET DEFAULT nextval('public.csync_records_id_seq'::regclass); + + +-- +-- Name: directos id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.directos ALTER COLUMN id SET DEFAULT nextval('public.directos_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: disputes id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.disputes ALTER COLUMN id SET DEFAULT nextval('public.disputes_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: dnskeys id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.dnskeys ALTER COLUMN id SET DEFAULT nextval('public.dnskeys_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: domain_contacts id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_contacts ALTER COLUMN id SET DEFAULT nextval('public.domain_contacts_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: domain_transfers id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_transfers ALTER COLUMN id SET DEFAULT nextval('public.domain_transfers_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: domains id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domains ALTER COLUMN id SET DEFAULT nextval('public.domains_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- 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: id; Type: DEFAULT; Schema: public; Owner: - +-- 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: id; Type: DEFAULT; Schema: public; Owner: - +-- 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: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: epp_sessions id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.epp_sessions ALTER COLUMN id SET DEFAULT nextval('public.epp_sessions_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.invoice_items ALTER COLUMN id SET DEFAULT nextval('public.invoice_items_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.invoices ALTER COLUMN id SET DEFAULT nextval('public.invoices_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.legal_documents ALTER COLUMN id SET DEFAULT nextval('public.legal_documents_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_account_activities ALTER COLUMN id SET DEFAULT nextval('public.log_account_activities_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_accounts ALTER COLUMN id SET DEFAULT nextval('public.log_accounts_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_actions ALTER COLUMN id SET DEFAULT nextval('public.log_actions_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_bank_statements ALTER COLUMN id SET DEFAULT nextval('public.log_bank_statements_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_bank_transactions ALTER COLUMN id SET DEFAULT nextval('public.log_bank_transactions_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_blocked_domains ALTER COLUMN id SET DEFAULT nextval('public.log_blocked_domains_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_certificates ALTER COLUMN id SET DEFAULT nextval('public.log_certificates_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_contacts ALTER COLUMN id SET DEFAULT nextval('public.log_contacts_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_dnskeys ALTER COLUMN id SET DEFAULT nextval('public.log_dnskeys_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_domain_contacts ALTER COLUMN id SET DEFAULT nextval('public.log_domain_contacts_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_domains ALTER COLUMN id SET DEFAULT nextval('public.log_domains_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_invoice_items ALTER COLUMN id SET DEFAULT nextval('public.log_invoice_items_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_invoices ALTER COLUMN id SET DEFAULT nextval('public.log_invoices_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_nameservers ALTER COLUMN id SET DEFAULT nextval('public.log_nameservers_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_notifications ALTER COLUMN id SET DEFAULT nextval('public.log_notifications_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_payment_orders ALTER COLUMN id SET DEFAULT nextval('public.log_payment_orders_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_prices ALTER COLUMN id SET DEFAULT nextval('public.log_prices_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_registrant_verifications ALTER COLUMN id SET DEFAULT nextval('public.log_registrant_verifications_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_registrars ALTER COLUMN id SET DEFAULT nextval('public.log_registrars_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_reserved_domains ALTER COLUMN id SET DEFAULT nextval('public.log_reserved_domains_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_setting_entries ALTER COLUMN id SET DEFAULT nextval('public.log_setting_entries_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_settings ALTER COLUMN id SET DEFAULT nextval('public.log_settings_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_users ALTER COLUMN id SET DEFAULT nextval('public.log_users_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_white_ips ALTER COLUMN id SET DEFAULT nextval('public.log_white_ips_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.nameservers ALTER COLUMN id SET DEFAULT nextval('public.nameservers_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.notifications ALTER COLUMN id SET DEFAULT nextval('public.notifications_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.payment_orders ALTER COLUMN id SET DEFAULT nextval('public.payment_orders_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.prices ALTER COLUMN id SET DEFAULT nextval('public.prices_id_seq'::regclass); - - --- --- Name: 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: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.registrant_verifications ALTER COLUMN id SET DEFAULT nextval('public.registrant_verifications_id_seq'::regclass); - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.accounts ALTER COLUMN id SET DEFAULT nextval('public.accounts_id_seq'::regclass); - - -ALTER TABLE ONLY public.log_invoices - ADD CONSTRAINT log_invoices_pkey PRIMARY KEY (id); - - -ALTER TABLE ONLY public.registrars ALTER COLUMN id SET DEFAULT nextval('public.registrars_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- -ALTER TABLE ONLY public.disputes ALTER COLUMN id SET DEFAULT nextval('public.disputes_id_seq'::regclass); - -ALTER TABLE ONLY public.log_nameservers - ADD CONSTRAINT log_nameservers_pkey PRIMARY KEY (id); - - -ALTER TABLE ONLY public.reserved_domains ALTER COLUMN id SET DEFAULT nextval('public.reserved_domains_id_seq'::regclass); - - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.setting_entries ALTER COLUMN id SET DEFAULT nextval('public.setting_entries_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.setting_entries ALTER COLUMN id SET DEFAULT nextval('public.setting_entries_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.settings ALTER COLUMN id SET DEFAULT nextval('public.settings_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.domains ALTER COLUMN id SET DEFAULT nextval('public.domains_id_seq'::regclass); - - --- --- Name: versions 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: white_ips 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: whois_records 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: zones id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.epp_sessions ALTER COLUMN id SET DEFAULT nextval('public.epp_sessions_id_seq'::regclass); - - --- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: invoice_items id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.invoice_items ALTER COLUMN id SET DEFAULT nextval('public.invoice_items_id_seq'::regclass); @@ -3273,6 +2947,13 @@ ALTER TABLE ONLY public.log_notifications ALTER COLUMN id SET DEFAULT nextval('p ALTER TABLE ONLY public.log_payment_orders ALTER COLUMN id SET DEFAULT nextval('public.log_payment_orders_id_seq'::regclass); +-- +-- Name: log_prices id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_prices ALTER COLUMN id SET DEFAULT nextval('public.log_prices_id_seq'::regclass); + + -- -- Name: log_registrant_verifications id; Type: DEFAULT; Schema: public; Owner: - -- @@ -3294,6 +2975,13 @@ ALTER TABLE ONLY public.log_registrars ALTER COLUMN id SET DEFAULT nextval('publ ALTER TABLE ONLY public.log_reserved_domains ALTER COLUMN id SET DEFAULT nextval('public.log_reserved_domains_id_seq'::regclass); +-- +-- Name: log_setting_entries id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_setting_entries ALTER COLUMN id SET DEFAULT nextval('public.log_setting_entries_id_seq'::regclass); + + -- -- Name: log_settings id; Type: DEFAULT; Schema: public; Owner: - -- @@ -3371,6 +3059,13 @@ ALTER TABLE ONLY public.registrars ALTER COLUMN id SET DEFAULT nextval('public.r ALTER TABLE ONLY public.reserved_domains ALTER COLUMN id SET DEFAULT nextval('public.reserved_domains_id_seq'::regclass); +-- +-- Name: setting_entries id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.setting_entries ALTER COLUMN id SET DEFAULT nextval('public.setting_entries_id_seq'::regclass); + + -- -- Name: settings id; Type: DEFAULT; Schema: public; Owner: - -- @@ -3384,43 +3079,37 @@ ALTER TABLE ONLY public.settings ALTER COLUMN id SET DEFAULT nextval('public.set ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass); -ALTER TABLE ONLY public.log_prices - ADD CONSTRAINT log_prices_pkey PRIMARY KEY (id); - - -ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass); - -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: versions id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.versions ALTER COLUMN id SET DEFAULT nextval('public.versions_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: white_ips id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.white_ips ALTER COLUMN id SET DEFAULT nextval('public.white_ips_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: whois_records id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.whois_records ALTER COLUMN id SET DEFAULT nextval('public.whois_records_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: zones id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.zones ALTER COLUMN id SET DEFAULT nextval('public.zones_id_seq'::regclass); -- --- Name: account_activities_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: account_activities account_activities_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.account_activities @@ -3428,7 +3117,7 @@ ALTER TABLE ONLY public.account_activities -- --- Name: accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: accounts accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.accounts @@ -3436,7 +3125,7 @@ ALTER TABLE ONLY public.accounts -- --- Name: actions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: actions actions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.actions @@ -3444,7 +3133,7 @@ ALTER TABLE ONLY public.actions -- --- Name: ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: ar_internal_metadata ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.ar_internal_metadata @@ -3452,7 +3141,7 @@ ALTER TABLE ONLY public.ar_internal_metadata -- --- Name: auctions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: auctions auctions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.auctions @@ -3460,7 +3149,7 @@ ALTER TABLE ONLY public.auctions -- --- Name: bank_statements_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: bank_statements bank_statements_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.bank_statements @@ -3468,7 +3157,7 @@ ALTER TABLE ONLY public.bank_statements -- --- Name: bank_transactions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: bank_transactions bank_transactions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.bank_transactions @@ -3476,7 +3165,7 @@ ALTER TABLE ONLY public.bank_transactions -- --- Name: blocked_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: blocked_domains blocked_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.blocked_domains @@ -3484,7 +3173,7 @@ ALTER TABLE ONLY public.blocked_domains -- --- Name: bounced_mail_addresses_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: bounced_mail_addresses bounced_mail_addresses_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.bounced_mail_addresses @@ -3492,7 +3181,7 @@ ALTER TABLE ONLY public.bounced_mail_addresses -- --- Name: certificates_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: certificates certificates_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.certificates @@ -3500,7 +3189,7 @@ ALTER TABLE ONLY public.certificates -- --- Name: contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: contacts contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.contacts @@ -3508,7 +3197,15 @@ ALTER TABLE ONLY public.contacts -- --- Name: directos_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: csync_records csync_records_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.csync_records + ADD CONSTRAINT csync_records_pkey PRIMARY KEY (id); + + +-- +-- Name: directos directos_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.directos @@ -3516,7 +3213,7 @@ ALTER TABLE ONLY public.directos -- --- Name: disputes_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: disputes disputes_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.disputes @@ -3524,7 +3221,7 @@ ALTER TABLE ONLY public.disputes -- --- Name: dnskeys_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: dnskeys dnskeys_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.dnskeys @@ -3532,7 +3229,7 @@ ALTER TABLE ONLY public.dnskeys -- --- Name: domain_contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: domain_contacts domain_contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_contacts @@ -3540,7 +3237,7 @@ ALTER TABLE ONLY public.domain_contacts -- --- Name: domain_transfers_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: domain_transfers domain_transfers_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_transfers @@ -3548,7 +3245,7 @@ ALTER TABLE ONLY public.domain_transfers -- --- Name: domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: domains domains_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domains @@ -3556,7 +3253,7 @@ ALTER TABLE ONLY public.domains -- --- Name: email_address_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: email_address_verifications email_address_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.email_address_verifications @@ -3564,7 +3261,7 @@ ALTER TABLE ONLY public.email_address_verifications -- --- Name: email_addresses_validations_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: email_addresses_validations email_addresses_validations_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.email_addresses_validations @@ -3572,7 +3269,7 @@ ALTER TABLE ONLY public.email_addresses_validations -- --- Name: email_addresses_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: email_addresses_verifications email_addresses_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.email_addresses_verifications @@ -3580,7 +3277,7 @@ ALTER TABLE ONLY public.email_addresses_verifications -- --- Name: epp_sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: epp_sessions epp_sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.epp_sessions @@ -3588,7 +3285,7 @@ ALTER TABLE ONLY public.epp_sessions -- --- Name: invoice_items_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: invoice_items invoice_items_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.invoice_items @@ -3596,7 +3293,7 @@ ALTER TABLE ONLY public.invoice_items -- --- Name: invoices_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: invoices invoices_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.invoices @@ -3604,7 +3301,7 @@ ALTER TABLE ONLY public.invoices -- --- Name: legal_documents_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: legal_documents legal_documents_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.legal_documents @@ -3612,7 +3309,7 @@ ALTER TABLE ONLY public.legal_documents -- --- Name: log_account_activities_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_account_activities log_account_activities_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_account_activities @@ -3620,7 +3317,7 @@ ALTER TABLE ONLY public.log_account_activities -- --- Name: log_accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_accounts log_accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_accounts @@ -3628,7 +3325,7 @@ ALTER TABLE ONLY public.log_accounts -- --- Name: log_actions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_actions log_actions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_actions @@ -3636,7 +3333,7 @@ ALTER TABLE ONLY public.log_actions -- --- Name: log_bank_statements_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_bank_statements log_bank_statements_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_bank_statements @@ -3644,7 +3341,7 @@ ALTER TABLE ONLY public.log_bank_statements -- --- Name: log_bank_transactions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_bank_transactions log_bank_transactions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_bank_transactions @@ -3652,7 +3349,7 @@ ALTER TABLE ONLY public.log_bank_transactions -- --- Name: log_blocked_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_blocked_domains log_blocked_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_blocked_domains @@ -3660,7 +3357,7 @@ ALTER TABLE ONLY public.log_blocked_domains -- --- Name: log_certificates_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_certificates log_certificates_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_certificates @@ -3668,7 +3365,7 @@ ALTER TABLE ONLY public.log_certificates -- --- Name: log_contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_contacts log_contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_contacts @@ -3676,7 +3373,7 @@ ALTER TABLE ONLY public.log_contacts -- --- Name: log_dnskeys_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_dnskeys log_dnskeys_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_dnskeys @@ -3684,7 +3381,7 @@ ALTER TABLE ONLY public.log_dnskeys -- --- Name: log_domain_contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_domain_contacts log_domain_contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_domain_contacts @@ -3692,7 +3389,7 @@ ALTER TABLE ONLY public.log_domain_contacts -- --- Name: log_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_domains log_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_domains @@ -3700,7 +3397,7 @@ ALTER TABLE ONLY public.log_domains -- --- Name: log_invoice_items_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_invoice_items log_invoice_items_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_invoice_items @@ -3708,7 +3405,23 @@ ALTER TABLE ONLY public.log_invoice_items -- --- Name: log_notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_invoices log_invoices_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_invoices + ADD CONSTRAINT log_invoices_pkey PRIMARY KEY (id); + + +-- +-- Name: log_nameservers log_nameservers_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_nameservers + ADD CONSTRAINT log_nameservers_pkey PRIMARY KEY (id); + + +-- +-- Name: log_notifications log_notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_notifications @@ -3716,7 +3429,7 @@ ALTER TABLE ONLY public.log_notifications -- --- Name: log_payment_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_payment_orders log_payment_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_payment_orders @@ -3724,7 +3437,15 @@ ALTER TABLE ONLY public.log_payment_orders -- --- Name: log_registrant_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_prices log_prices_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_prices + ADD CONSTRAINT log_prices_pkey PRIMARY KEY (id); + + +-- +-- Name: log_registrant_verifications log_registrant_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_registrant_verifications @@ -3732,7 +3453,7 @@ ALTER TABLE ONLY public.log_registrant_verifications -- --- Name: log_registrars_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_registrars log_registrars_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_registrars @@ -3740,7 +3461,7 @@ ALTER TABLE ONLY public.log_registrars -- --- Name: log_reserved_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_reserved_domains log_reserved_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_reserved_domains @@ -3748,7 +3469,7 @@ ALTER TABLE ONLY public.log_reserved_domains -- --- Name: log_setting_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_setting_entries log_setting_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_setting_entries @@ -3756,7 +3477,7 @@ ALTER TABLE ONLY public.log_setting_entries -- --- Name: log_settings_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_settings log_settings_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_settings @@ -3764,7 +3485,7 @@ ALTER TABLE ONLY public.log_settings -- --- Name: log_users_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_users log_users_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_users @@ -3772,7 +3493,7 @@ ALTER TABLE ONLY public.log_users -- --- Name: log_white_ips_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_white_ips log_white_ips_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_white_ips @@ -3780,7 +3501,7 @@ ALTER TABLE ONLY public.log_white_ips -- --- Name: nameservers_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: nameservers nameservers_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.nameservers @@ -3788,7 +3509,7 @@ ALTER TABLE ONLY public.nameservers -- --- Name: notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: notifications notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.notifications @@ -3796,7 +3517,7 @@ ALTER TABLE ONLY public.notifications -- --- Name: payment_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: payment_orders payment_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.payment_orders @@ -3804,7 +3525,7 @@ ALTER TABLE ONLY public.payment_orders -- --- Name: prices_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: prices prices_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.prices @@ -3812,7 +3533,7 @@ ALTER TABLE ONLY public.prices -- --- Name: que_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: que_jobs que_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.que_jobs @@ -3820,7 +3541,7 @@ ALTER TABLE ONLY public.que_jobs -- --- Name: registrant_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: registrant_verifications registrant_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.registrant_verifications @@ -3828,7 +3549,7 @@ ALTER TABLE ONLY public.registrant_verifications -- --- Name: registrars_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: registrars registrars_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.registrars @@ -3836,7 +3557,7 @@ ALTER TABLE ONLY public.registrars -- --- Name: reserved_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: reserved_domains reserved_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.reserved_domains @@ -3844,7 +3565,7 @@ ALTER TABLE ONLY public.reserved_domains -- --- Name: setting_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: setting_entries setting_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.setting_entries @@ -3852,7 +3573,7 @@ ALTER TABLE ONLY public.setting_entries -- --- Name: settings_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: settings settings_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.settings @@ -3860,7 +3581,7 @@ ALTER TABLE ONLY public.settings -- --- Name: uniq_blocked_domains_name; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: blocked_domains uniq_blocked_domains_name; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.blocked_domains @@ -3868,7 +3589,7 @@ ALTER TABLE ONLY public.blocked_domains -- --- Name: uniq_contact_of_type_per_domain; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: domain_contacts uniq_contact_of_type_per_domain; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_contacts @@ -3876,7 +3597,7 @@ ALTER TABLE ONLY public.domain_contacts -- --- Name: uniq_contact_uuid; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: contacts uniq_contact_uuid; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.contacts @@ -3884,7 +3605,7 @@ ALTER TABLE ONLY public.contacts -- --- Name: uniq_domain_uuid; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: domains uniq_domain_uuid; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domains @@ -3892,7 +3613,7 @@ ALTER TABLE ONLY public.domains -- --- Name: uniq_hostname_per_domain; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: nameservers uniq_hostname_per_domain; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.nameservers @@ -3900,7 +3621,7 @@ ALTER TABLE ONLY public.nameservers -- --- Name: uniq_reserved_domains_name; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: reserved_domains uniq_reserved_domains_name; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.reserved_domains @@ -3908,7 +3629,7 @@ ALTER TABLE ONLY public.reserved_domains -- --- Name: uniq_uuid; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: auctions uniq_uuid; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.auctions @@ -3916,7 +3637,7 @@ ALTER TABLE ONLY public.auctions -- --- Name: unique_code; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: registrars unique_code; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.registrars @@ -3924,7 +3645,7 @@ ALTER TABLE ONLY public.registrars -- --- Name: unique_contact_code; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: contacts unique_contact_code; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.contacts @@ -3932,7 +3653,7 @@ ALTER TABLE ONLY public.contacts -- --- Name: unique_name; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: registrars unique_name; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.registrars @@ -3940,7 +3661,7 @@ ALTER TABLE ONLY public.registrars -- --- Name: unique_number; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: invoices unique_number; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.invoices @@ -3948,7 +3669,7 @@ ALTER TABLE ONLY public.invoices -- --- Name: unique_reference_no; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: registrars unique_reference_no; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.registrars @@ -3956,7 +3677,7 @@ ALTER TABLE ONLY public.registrars -- --- Name: unique_registration_code; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: auctions unique_registration_code; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.auctions @@ -3964,7 +3685,7 @@ ALTER TABLE ONLY public.auctions -- --- Name: unique_session_id; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: epp_sessions unique_session_id; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.epp_sessions @@ -3972,7 +3693,7 @@ ALTER TABLE ONLY public.epp_sessions -- --- Name: unique_zone_origin; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: zones unique_zone_origin; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.zones @@ -3980,7 +3701,7 @@ ALTER TABLE ONLY public.zones -- --- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.users @@ -3988,7 +3709,7 @@ ALTER TABLE ONLY public.users -- --- Name: versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: versions versions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.versions @@ -3996,7 +3717,7 @@ ALTER TABLE ONLY public.versions -- --- Name: white_ips_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: white_ips white_ips_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.white_ips @@ -4004,7 +3725,7 @@ ALTER TABLE ONLY public.white_ips -- --- Name: whois_records_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: whois_records whois_records_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.whois_records @@ -4012,7 +3733,7 @@ ALTER TABLE ONLY public.whois_records -- --- Name: zones_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: zones zones_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.zones @@ -4020,624 +3741,628 @@ ALTER TABLE ONLY public.zones -- --- Name: index_account_activities_on_account_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_account_activities_on_account_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_account_activities_on_account_id ON public.account_activities USING btree (account_id); -- --- Name: index_account_activities_on_bank_transaction_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_account_activities_on_bank_transaction_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_account_activities_on_bank_transaction_id ON public.account_activities USING btree (bank_transaction_id); -- --- Name: index_account_activities_on_invoice_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_account_activities_on_invoice_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_account_activities_on_invoice_id ON public.account_activities USING btree (invoice_id); -- --- Name: index_accounts_on_registrar_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_accounts_on_registrar_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_accounts_on_registrar_id ON public.accounts USING btree (registrar_id); -- --- Name: index_certificates_on_api_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_certificates_on_api_user_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_certificates_on_api_user_id ON public.certificates USING btree (api_user_id); -- --- Name: index_contacts_on_code; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_contacts_on_code; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_contacts_on_code ON public.contacts USING btree (code); -- --- Name: index_contacts_on_registrar_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_contacts_on_registrar_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_contacts_on_registrar_id ON public.contacts USING btree (registrar_id); -- --- Name: index_contacts_on_registrar_id_and_ident_type; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_contacts_on_registrar_id_and_ident_type; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_contacts_on_registrar_id_and_ident_type ON public.contacts USING btree (registrar_id, ident_type); --- --- Name: index_directos_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_directos_on_item_type_and_item_id ON public.directos USING btree (item_type, item_id); - - --- --- Name: index_dnskeys_on_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_dnskeys_on_domain_id ON public.dnskeys USING btree (domain_id); - - --- --- Name: index_dnskeys_on_legacy_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_dnskeys_on_legacy_domain_id ON public.dnskeys USING btree (legacy_domain_id); - - --- --- Name: index_domain_contacts_on_contact_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_domain_contacts_on_contact_id ON public.domain_contacts USING btree (contact_id); - - --- --- Name: index_domain_contacts_on_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_domain_contacts_on_domain_id ON public.domain_contacts USING btree (domain_id); - - --- --- Name: index_domain_transfers_on_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_domain_transfers_on_domain_id ON public.domain_transfers USING btree (domain_id); - - --- --- Name: index_domains_on_delete_date; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_domains_on_delete_date ON public.domains USING btree (delete_date); - - --- --- Name: index_domains_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE UNIQUE INDEX index_domains_on_name ON public.domains USING btree (name); - - --- --- Name: index_domains_on_outzone_at; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_domains_on_outzone_at ON public.domains USING btree (outzone_at); - - --- --- Name: index_domains_on_registrant_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_domains_on_registrant_id ON public.domains USING btree (registrant_id); - - --- --- Name: index_domains_on_registrant_verification_asked_at; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_domains_on_registrant_verification_asked_at ON public.domains USING btree (registrant_verification_asked_at); - - --- --- Name: index_domains_on_registrant_verification_token; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_domains_on_registrant_verification_token ON public.domains USING btree (registrant_verification_token); - - --- --- Name: index_domains_on_registrar_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_domains_on_registrar_id ON public.domains USING btree (registrar_id); - - --- --- Name: index_domains_on_statuses; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_domains_on_statuses ON public.domains USING gin (statuses); - - --- --- Name: index_email_address_verifications_on_domain; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -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: -; Tablespace: --- - -CREATE INDEX index_epp_sessions_on_updated_at ON public.epp_sessions USING btree (updated_at); - - --- --- Name: index_invoice_items_on_invoice_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_invoice_items_on_invoice_id ON public.invoice_items USING btree (invoice_id); - - --- --- Name: index_invoices_on_buyer_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_invoices_on_buyer_id ON public.invoices USING btree (buyer_id); - - --- --- Name: index_legal_documents_on_checksum; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_legal_documents_on_checksum ON public.legal_documents USING btree (checksum); - - --- --- Name: index_legal_documents_on_documentable_type_and_documentable_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_legal_documents_on_documentable_type_and_documentable_id ON public.legal_documents USING btree (documentable_type, documentable_id); - - --- --- Name: index_log_account_activities_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_log_account_activities_on_item_type_and_item_id ON public.log_account_activities USING btree (item_type, item_id); - - --- --- Name: index_log_account_activities_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_log_account_activities_on_whodunnit ON public.log_account_activities USING btree (whodunnit); - - --- --- Name: index_log_accounts_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_log_accounts_on_item_type_and_item_id ON public.log_accounts USING btree (item_type, item_id); - - --- --- Name: index_log_accounts_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_log_accounts_on_whodunnit ON public.log_accounts USING btree (whodunnit); - - --- --- Name: index_log_bank_statements_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_log_bank_statements_on_item_type_and_item_id ON public.log_bank_statements USING btree (item_type, item_id); - - --- --- Name: index_log_bank_statements_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_log_bank_statements_on_whodunnit ON public.log_bank_statements USING btree (whodunnit); - - --- --- Name: index_log_bank_transactions_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_log_bank_transactions_on_item_type_and_item_id ON public.log_bank_transactions USING btree (item_type, item_id); - - --- --- Name: index_log_bank_transactions_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_log_bank_transactions_on_whodunnit ON public.log_bank_transactions USING btree (whodunnit); - - --- --- Name: index_log_blocked_domains_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_log_blocked_domains_on_item_type_and_item_id ON public.log_blocked_domains USING btree (item_type, item_id); - - --- --- Name: index_log_blocked_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_log_blocked_domains_on_whodunnit ON public.log_blocked_domains USING btree (whodunnit); - - --- --- Name: index_log_certificates_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_log_certificates_on_item_type_and_item_id ON public.log_certificates USING btree (item_type, item_id); - - --- --- Name: index_log_certificates_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_log_certificates_on_whodunnit ON public.log_certificates USING btree (whodunnit); - - --- --- Name: index_log_contacts_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_log_contacts_on_item_type_and_item_id ON public.log_contacts USING btree (item_type, item_id); - - --- --- Name: index_log_contacts_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_log_contacts_on_whodunnit ON public.log_contacts USING btree (whodunnit); - - --- --- Name: index_log_dnskeys_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: --- - -CREATE INDEX index_log_dnskeys_on_item_type_and_item_id ON public.log_dnskeys USING btree (item_type, item_id); - - --- --- Name: csync_records id; Type: DEFAULT; Schema: public; Owner: - --- -ALTER TABLE ONLY public.csync_records ALTER COLUMN id SET DEFAULT nextval('public.csync_records_id_seq'::regclass); - -- -- Name: index_csync_records_on_domain_id; Type: INDEX; Schema: public; Owner: - -- CREATE UNIQUE INDEX index_csync_records_on_domain_id ON public.csync_records USING btree (domain_id); + -- --- Name: index_log_dnskeys_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_directos_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_directos_on_item_type_and_item_id ON public.directos USING btree (item_type, item_id); + + +-- +-- Name: index_dnskeys_on_domain_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_dnskeys_on_domain_id ON public.dnskeys USING btree (domain_id); + + +-- +-- Name: index_dnskeys_on_legacy_domain_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_dnskeys_on_legacy_domain_id ON public.dnskeys USING btree (legacy_domain_id); + + +-- +-- Name: index_domain_contacts_on_contact_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_domain_contacts_on_contact_id ON public.domain_contacts USING btree (contact_id); + + +-- +-- Name: index_domain_contacts_on_domain_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_domain_contacts_on_domain_id ON public.domain_contacts USING btree (domain_id); + + +-- +-- Name: index_domain_transfers_on_domain_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_domain_transfers_on_domain_id ON public.domain_transfers USING btree (domain_id); + + +-- +-- Name: index_domains_on_delete_date; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_domains_on_delete_date ON public.domains USING btree (delete_date); + + +-- +-- Name: index_domains_on_json_statuses_history; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_domains_on_json_statuses_history ON public.domains USING gin (json_statuses_history); + + +-- +-- Name: index_domains_on_name; Type: INDEX; Schema: public; Owner: - +-- + +CREATE UNIQUE INDEX index_domains_on_name ON public.domains USING btree (name); + + +-- +-- Name: index_domains_on_outzone_at; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_domains_on_outzone_at ON public.domains USING btree (outzone_at); + + +-- +-- Name: index_domains_on_registrant_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_domains_on_registrant_id ON public.domains USING btree (registrant_id); + + +-- +-- Name: index_domains_on_registrant_verification_asked_at; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_domains_on_registrant_verification_asked_at ON public.domains USING btree (registrant_verification_asked_at); + + +-- +-- Name: index_domains_on_registrant_verification_token; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_domains_on_registrant_verification_token ON public.domains USING btree (registrant_verification_token); + + +-- +-- Name: index_domains_on_registrar_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_domains_on_registrar_id ON public.domains USING btree (registrar_id); + + +-- +-- Name: index_domains_on_statuses; Type: INDEX; Schema: public; Owner: - +-- + +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: - +-- + +CREATE INDEX index_epp_sessions_on_updated_at ON public.epp_sessions USING btree (updated_at); + + +-- +-- Name: index_invoice_items_on_invoice_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_invoice_items_on_invoice_id ON public.invoice_items USING btree (invoice_id); + + +-- +-- Name: index_invoices_on_buyer_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_invoices_on_buyer_id ON public.invoices USING btree (buyer_id); + + +-- +-- Name: index_legal_documents_on_checksum; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_legal_documents_on_checksum ON public.legal_documents USING btree (checksum); + + +-- +-- Name: index_legal_documents_on_documentable_type_and_documentable_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_legal_documents_on_documentable_type_and_documentable_id ON public.legal_documents USING btree (documentable_type, documentable_id); + + +-- +-- Name: index_log_account_activities_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_log_account_activities_on_item_type_and_item_id ON public.log_account_activities USING btree (item_type, item_id); + + +-- +-- Name: index_log_account_activities_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_log_account_activities_on_whodunnit ON public.log_account_activities USING btree (whodunnit); + + +-- +-- Name: index_log_accounts_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_log_accounts_on_item_type_and_item_id ON public.log_accounts USING btree (item_type, item_id); + + +-- +-- Name: index_log_accounts_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_log_accounts_on_whodunnit ON public.log_accounts USING btree (whodunnit); + + +-- +-- Name: index_log_bank_statements_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_log_bank_statements_on_item_type_and_item_id ON public.log_bank_statements USING btree (item_type, item_id); + + +-- +-- Name: index_log_bank_statements_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_log_bank_statements_on_whodunnit ON public.log_bank_statements USING btree (whodunnit); + + +-- +-- Name: index_log_bank_transactions_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_log_bank_transactions_on_item_type_and_item_id ON public.log_bank_transactions USING btree (item_type, item_id); + + +-- +-- Name: index_log_bank_transactions_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_log_bank_transactions_on_whodunnit ON public.log_bank_transactions USING btree (whodunnit); + + +-- +-- Name: index_log_blocked_domains_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_log_blocked_domains_on_item_type_and_item_id ON public.log_blocked_domains USING btree (item_type, item_id); + + +-- +-- Name: index_log_blocked_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_log_blocked_domains_on_whodunnit ON public.log_blocked_domains USING btree (whodunnit); + + +-- +-- Name: index_log_certificates_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_log_certificates_on_item_type_and_item_id ON public.log_certificates USING btree (item_type, item_id); + + +-- +-- Name: index_log_certificates_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_log_certificates_on_whodunnit ON public.log_certificates USING btree (whodunnit); + + +-- +-- Name: index_log_contacts_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_log_contacts_on_item_type_and_item_id ON public.log_contacts USING btree (item_type, item_id); + + +-- +-- Name: index_log_contacts_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_log_contacts_on_whodunnit ON public.log_contacts USING btree (whodunnit); + + +-- +-- Name: index_log_dnskeys_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_log_dnskeys_on_item_type_and_item_id ON public.log_dnskeys USING btree (item_type, item_id); + + +-- +-- Name: index_log_dnskeys_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_dnskeys_on_whodunnit ON public.log_dnskeys USING btree (whodunnit); -- --- Name: index_log_domain_contacts_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_domain_contacts_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_domain_contacts_on_item_type_and_item_id ON public.log_domain_contacts USING btree (item_type, item_id); -- --- Name: index_log_domain_contacts_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_domain_contacts_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_domain_contacts_on_whodunnit ON public.log_domain_contacts USING btree (whodunnit); -- --- Name: index_log_domains_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_domains_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_domains_on_item_type_and_item_id ON public.log_domains USING btree (item_type, item_id); -- --- Name: index_log_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_domains_on_whodunnit ON public.log_domains USING btree (whodunnit); -- --- Name: index_log_invoice_items_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_invoice_items_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_invoice_items_on_item_type_and_item_id ON public.log_invoice_items USING btree (item_type, item_id); -- --- Name: index_log_invoice_items_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_invoice_items_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_invoice_items_on_whodunnit ON public.log_invoice_items USING btree (whodunnit); -- --- Name: index_log_invoices_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_invoices_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_invoices_on_item_type_and_item_id ON public.log_invoices USING btree (item_type, item_id); -- --- Name: index_log_invoices_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_invoices_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_invoices_on_whodunnit ON public.log_invoices USING btree (whodunnit); -- --- Name: index_log_nameservers_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_nameservers_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_nameservers_on_item_type_and_item_id ON public.log_nameservers USING btree (item_type, item_id); -- --- Name: index_log_nameservers_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_nameservers_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_nameservers_on_whodunnit ON public.log_nameservers USING btree (whodunnit); -- --- Name: index_log_notifications_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_notifications_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_notifications_on_item_type_and_item_id ON public.log_notifications USING btree (item_type, item_id); -- --- Name: index_log_notifications_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_notifications_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_notifications_on_whodunnit ON public.log_notifications USING btree (whodunnit); -- --- Name: index_log_registrant_verifications_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_registrant_verifications_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_registrant_verifications_on_item_type_and_item_id ON public.log_registrant_verifications USING btree (item_type, item_id); -- --- Name: index_log_registrant_verifications_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_registrant_verifications_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_registrant_verifications_on_whodunnit ON public.log_registrant_verifications USING btree (whodunnit); -- --- Name: index_log_registrars_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_registrars_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_registrars_on_item_type_and_item_id ON public.log_registrars USING btree (item_type, item_id); -- --- Name: index_log_registrars_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_registrars_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_registrars_on_whodunnit ON public.log_registrars USING btree (whodunnit); -- --- Name: index_log_reserved_domains_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_reserved_domains_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_reserved_domains_on_item_type_and_item_id ON public.log_reserved_domains USING btree (item_type, item_id); -- --- Name: index_log_reserved_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_reserved_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_reserved_domains_on_whodunnit ON public.log_reserved_domains USING btree (whodunnit); -- --- Name: index_log_setting_entries_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_setting_entries_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_setting_entries_on_item_type_and_item_id ON public.log_setting_entries USING btree (item_type, item_id); -- --- Name: index_log_setting_entries_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_setting_entries_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_setting_entries_on_whodunnit ON public.log_setting_entries USING btree (whodunnit); -- --- Name: index_log_settings_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_settings_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_settings_on_item_type_and_item_id ON public.log_settings USING btree (item_type, item_id); -- --- Name: index_log_settings_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_settings_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_settings_on_whodunnit ON public.log_settings USING btree (whodunnit); -- --- Name: index_log_users_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_users_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_users_on_item_type_and_item_id ON public.log_users USING btree (item_type, item_id); -- --- Name: index_log_users_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_users_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_users_on_whodunnit ON public.log_users USING btree (whodunnit); -- --- Name: index_nameservers_on_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_nameservers_on_domain_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_nameservers_on_domain_id ON public.nameservers USING btree (domain_id); -- --- Name: index_notifications_on_registrar_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_notifications_on_registrar_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_notifications_on_registrar_id ON public.notifications USING btree (registrar_id); -- --- Name: index_payment_orders_on_invoice_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_payment_orders_on_invoice_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_payment_orders_on_invoice_id ON public.payment_orders USING btree (invoice_id); -- --- Name: index_prices_on_zone_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_prices_on_zone_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_prices_on_zone_id ON public.prices USING btree (zone_id); -- --- Name: index_registrant_verifications_on_created_at; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_registrant_verifications_on_created_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_registrant_verifications_on_created_at ON public.registrant_verifications USING btree (created_at); -- --- Name: index_registrant_verifications_on_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_registrant_verifications_on_domain_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_registrant_verifications_on_domain_id ON public.registrant_verifications USING btree (domain_id); -- --- Name: index_setting_entries_on_code; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_setting_entries_on_code; Type: INDEX; Schema: public; Owner: - -- CREATE UNIQUE INDEX index_setting_entries_on_code ON public.setting_entries USING btree (code); -- --- Name: index_settings_on_thing_type_and_thing_id_and_var; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_settings_on_thing_type_and_thing_id_and_var; Type: INDEX; Schema: public; Owner: - -- CREATE UNIQUE INDEX index_settings_on_thing_type_and_thing_id_and_var ON public.settings USING btree (thing_type, thing_id, var); -- --- Name: index_users_on_identity_code; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_users_on_identity_code; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_users_on_identity_code ON public.users USING btree (identity_code); -- --- Name: index_users_on_registrar_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_users_on_registrar_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_users_on_registrar_id ON public.users USING btree (registrar_id); -- --- Name: index_versions_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_versions_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_versions_on_item_type_and_item_id ON public.versions USING btree (item_type, item_id); -- --- Name: index_whois_records_on_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_whois_records_on_domain_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_whois_records_on_domain_id ON public.whois_records USING btree (domain_id); -- --- Name: index_whois_records_on_registrar_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_whois_records_on_registrar_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_whois_records_on_registrar_id ON public.whois_records USING btree (registrar_id); -- --- Name: log_contacts_object_legacy_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: log_contacts_object_legacy_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX log_contacts_object_legacy_id ON public.log_contacts USING btree ((((object ->> 'legacy_id'::text))::integer)); -- --- Name: log_dnskeys_object_legacy_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: log_dnskeys_object_legacy_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX log_dnskeys_object_legacy_id ON public.log_contacts USING btree ((((object ->> 'legacy_domain_id'::text))::integer)); -- --- Name: log_domains_object_legacy_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: log_domains_object_legacy_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX log_domains_object_legacy_id ON public.log_contacts USING btree ((((object ->> 'legacy_id'::text))::integer)); -- --- Name: log_nameservers_object_legacy_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: log_nameservers_object_legacy_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX log_nameservers_object_legacy_id ON public.log_contacts USING btree ((((object ->> 'legacy_domain_id'::text))::integer)); -- --- Name: unique_data_migrations; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: unique_data_migrations; Type: INDEX; Schema: public; Owner: - -- CREATE UNIQUE INDEX unique_data_migrations ON public.data_migrations USING btree (version); -- --- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: - -- CREATE UNIQUE INDEX unique_schema_migrations ON public.schema_migrations USING btree (version); + -- -- Name: contacts contacts_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -4647,7 +4372,7 @@ ALTER TABLE ONLY public.contacts -- --- Name: domain_contacts_contact_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: domain_contacts domain_contacts_contact_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_contacts @@ -4655,7 +4380,7 @@ ALTER TABLE ONLY public.domain_contacts -- --- Name: domain_contacts_domain_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: domain_contacts domain_contacts_domain_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_contacts @@ -4663,7 +4388,7 @@ ALTER TABLE ONLY public.domain_contacts -- --- Name: domains_registrant_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: domains domains_registrant_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domains @@ -4671,7 +4396,7 @@ ALTER TABLE ONLY public.domains -- --- Name: domains_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: domains domains_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domains @@ -4679,7 +4404,7 @@ ALTER TABLE ONLY public.domains -- --- Name: fk_rails_242b91538b; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: invoices fk_rails_242b91538b; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.invoices @@ -4687,7 +4412,7 @@ ALTER TABLE ONLY public.invoices -- --- Name: fk_rails_36cff3de9c; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: white_ips fk_rails_36cff3de9c; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.white_ips @@ -4695,7 +4420,7 @@ ALTER TABLE ONLY public.white_ips -- --- Name: fk_rails_59c422f73d; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: domain_transfers fk_rails_59c422f73d; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_transfers @@ -4703,7 +4428,15 @@ ALTER TABLE ONLY public.domain_transfers -- --- Name: fk_rails_78c376257f; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: csync_records fk_rails_5df85aeb13; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.csync_records + ADD CONSTRAINT fk_rails_5df85aeb13 FOREIGN KEY (domain_id) REFERENCES public.domains(id); + + +-- +-- Name: prices fk_rails_78c376257f; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.prices @@ -4711,7 +4444,7 @@ ALTER TABLE ONLY public.prices -- --- Name: fk_rails_833ed7f3c0; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: domain_transfers fk_rails_833ed7f3c0; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_transfers @@ -4719,7 +4452,7 @@ ALTER TABLE ONLY public.domain_transfers -- --- Name: fk_rails_86cd2b09f5; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: account_activities fk_rails_86cd2b09f5; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.account_activities @@ -4727,7 +4460,7 @@ ALTER TABLE ONLY public.account_activities -- --- Name: fk_rails_87b8e40c63; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: domain_transfers fk_rails_87b8e40c63; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_transfers @@ -4735,7 +4468,7 @@ ALTER TABLE ONLY public.domain_transfers -- --- Name: fk_rails_8c6b5c12eb; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: actions fk_rails_8c6b5c12eb; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.actions @@ -4743,7 +4476,7 @@ ALTER TABLE ONLY public.actions -- --- Name: fk_rails_8f9734b530; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: notifications fk_rails_8f9734b530; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.notifications @@ -4751,7 +4484,7 @@ ALTER TABLE ONLY public.notifications -- --- Name: fk_rails_a5ae3c203d; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: actions fk_rails_a5ae3c203d; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.actions @@ -4759,7 +4492,7 @@ ALTER TABLE ONLY public.actions -- --- Name: fk_rails_adff2dc8e3; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: epp_sessions fk_rails_adff2dc8e3; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.epp_sessions @@ -4767,7 +4500,7 @@ ALTER TABLE ONLY public.epp_sessions -- --- Name: fk_rails_b80dbb973d; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: account_activities fk_rails_b80dbb973d; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.account_activities @@ -4775,7 +4508,7 @@ ALTER TABLE ONLY public.account_activities -- --- Name: fk_rails_c9f635c0b3; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: accounts fk_rails_c9f635c0b3; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.accounts @@ -4783,7 +4516,7 @@ ALTER TABLE ONLY public.accounts -- --- Name: fk_rails_ce38d749f6; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: account_activities fk_rails_ce38d749f6; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.account_activities @@ -4791,7 +4524,7 @@ ALTER TABLE ONLY public.account_activities -- --- Name: fk_rails_d2cc3c2fa9; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: account_activities fk_rails_d2cc3c2fa9; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.account_activities @@ -4799,7 +4532,7 @@ ALTER TABLE ONLY public.account_activities -- --- Name: fk_rails_f41617a0e9; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: registrant_verifications fk_rails_f41617a0e9; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.registrant_verifications @@ -4807,7 +4540,7 @@ ALTER TABLE ONLY public.registrant_verifications -- --- Name: fk_rails_f9dc5857c3; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: payment_orders fk_rails_f9dc5857c3; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.payment_orders @@ -4815,7 +4548,7 @@ ALTER TABLE ONLY public.payment_orders -- --- Name: invoice_items_invoice_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: invoice_items invoice_items_invoice_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.invoice_items @@ -4823,7 +4556,7 @@ ALTER TABLE ONLY public.invoice_items -- --- Name: messages_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: notifications messages_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.notifications @@ -4831,7 +4564,7 @@ ALTER TABLE ONLY public.notifications -- --- Name: nameservers_domain_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: nameservers nameservers_domain_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.nameservers @@ -4839,25 +4572,12 @@ ALTER TABLE ONLY public.nameservers -- --- Name: user_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: users user_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.users ADD CONSTRAINT user_registrar_id_fk FOREIGN KEY (registrar_id) REFERENCES public.registrars(id); --- --- Name: csync_records csync_records_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.csync_records - ADD CONSTRAINT csync_records_pkey PRIMARY KEY (id); - --- --- Name: csync_records fk_rails_5df85aeb13; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.csync_records - ADD CONSTRAINT fk_rails_5df85aeb13 FOREIGN KEY (domain_id) REFERENCES public.domains(id); -- -- PostgreSQL database dump complete @@ -5286,9 +5006,9 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200518104105'), ('20200529115011'), ('20200605100827'), +('20200605125332'), ('20200610090110'), ('20200630081231'), -('20200605125332'), ('20200714115338'), ('20200807110611'), ('20200811074839'), @@ -5299,6 +5019,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200910085157'), ('20200910102028'), ('20200916125326'), -('20200917104213'), ('20210215101019'), -('20200921084356'); +('20210405100631'); + + diff --git a/test/models/domain/registry_lockable_test.rb b/test/models/domain/registry_lockable_test.rb index 6e4a1826c..ea812cf68 100644 --- a/test/models/domain/registry_lockable_test.rb +++ b/test/models/domain/registry_lockable_test.rb @@ -33,6 +33,16 @@ class DomainRegistryLockableTest < ActiveSupport::TestCase assert_not(@domain.locked_by_registrant?) end + def test_restore_domain_statuses_after_unlock + @domain.update(statuses: [DomainStatus::SERVER_UPDATE_PROHIBITED]) + @domain.apply_registry_lock + assert @domain.locked_by_registrant? + assert_equal @domain.statuses.sort, Domain::RegistryLockable::LOCK_STATUSES.sort + + @domain.remove_registry_lock + assert @domain.statuses.include? DomainStatus::SERVER_UPDATE_PROHIBITED + end + def test_registry_lock_on_lockable_domain refute(@domain.locked_by_registrant?) @domain.apply_registry_lock diff --git a/test/models/domain_test.rb b/test/models/domain_test.rb index 15ab8b0c2..8740fe853 100644 --- a/test/models/domain_test.rb +++ b/test/models/domain_test.rb @@ -27,6 +27,16 @@ class DomainTest < ActiveSupport::TestCase assert domains(:invalid).invalid? end + def test_valid_domain_statuses_history + @domain.force_delete_domain_statuses_history = [DomainStatus::SERVER_UPDATE_PROHIBITED, DomainStatus::SERVER_TRANSFER_PROHIBITED] + @domain.locked_domain_statuses_history = [DomainStatus::SERVER_UPDATE_PROHIBITED] + assert @domain.valid? + + assert @domain.json_statuses_history['force_delete_domain_statuses_history'].include? 'serverUpdateProhibited' + assert @domain.json_statuses_history['force_delete_domain_statuses_history'].include? 'serverTransferProhibited' + assert_equal @domain.json_statuses_history['locked_domain_statuses_history'], ['serverUpdateProhibited'] + end + # https://www.internet.ee/domeenid/ee-domeenireeglid#domeeninimede-registreerimine def test_validates_name_format assert_equal dns_zones(:one).origin, 'test' From 9bfdb0fb39de5575b7c03d79664ace1bf61ccc4f Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Mon, 5 Apr 2021 16:14:32 +0300 Subject: [PATCH 02/12] clear unnecessary code in structure, refactored formatted code --- .../concerns/domain/registry_lockable.rb | 24 +- app/models/domain.rb | 5 +- db/structure.sql | 1074 +++++++++++------ 3 files changed, 700 insertions(+), 403 deletions(-) diff --git a/app/models/concerns/domain/registry_lockable.rb b/app/models/concerns/domain/registry_lockable.rb index a350fabff..98bef7931 100644 --- a/app/models/concerns/domain/registry_lockable.rb +++ b/app/models/concerns/domain/registry_lockable.rb @@ -1,8 +1,6 @@ module Domain::RegistryLockable extend ActiveSupport::Concern - # status_notes public.hstore, - LOCK_STATUSES = [DomainStatus::SERVER_UPDATE_PROHIBITED, DomainStatus::SERVER_DELETE_PROHIBITED, DomainStatus::SERVER_TRANSFER_PROHIBITED].freeze @@ -11,11 +9,7 @@ module Domain::RegistryLockable return unless registry_lockable? return if locked_by_registrant? - self.locked_domain_statuses_history = self.statuses.map do |status| - if LOCK_STATUSES.include? status - status - end - end + put_statuses_to_json_history_before_locked transaction do self.statuses |= LOCK_STATUSES @@ -44,9 +38,7 @@ module Domain::RegistryLockable transaction do LOCK_STATUSES.each do |domain_status| - unless self.locked_domain_statuses_history.include? domain_status - statuses.delete(domain_status) - end + delete_domain_statuses_which_not_declared_before domain_status end self.locked_by_registrant_at = nil alert_registrar_lock_changes!(lock: false) @@ -64,4 +56,16 @@ module Domain::RegistryLockable attached_obj_type: self.class.name ) end + + private + + def put_statuses_to_json_history_before_locked + self.locked_domain_statuses_history = statuses.map do |status| + status if LOCK_STATUSES.include? status + end + end + + def delete_domain_statuses_which_not_declared_before(domain_status) + statuses.delete(domain_status) unless locked_domain_statuses_history.include? domain_status + end end diff --git a/app/models/domain.rb b/app/models/domain.rb index 0ec16cb9c..82c5b3ea2 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -16,8 +16,9 @@ class Domain < ApplicationRecord attr_accessor :legal_document_id - # serialize :json_statuses_history, HashSerializer - store_accessor :json_statuses_history, :force_delete_domain_statuses_history, :locked_domain_statuses_history + store_accessor :json_statuses_history, + :force_delete_domain_statuses_history, + :locked_domain_statuses_history alias_attribute :on_hold_time, :outzone_at alias_attribute :outzone_time, :outzone_at diff --git a/db/structure.sql b/db/structure.sql index a028cd32c..cac8a05df 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -1,13 +1,29 @@ +--- +--- PostgreSQL database dump +--- + SET statement_timeout = 0; SET lock_timeout = 0; -SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; -SET row_security = off; + +-- +-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; + + +-- +-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; + -- -- Name: btree_gist; Type: EXTENSION; Schema: -; Owner: - @@ -194,7 +210,7 @@ SET default_tablespace = ''; SET default_with_oids = false; -- --- Name: account_activities; Type: TABLE; Schema: public; Owner: - +-- Name: account_activities; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.account_activities ( @@ -235,7 +251,7 @@ ALTER SEQUENCE public.account_activities_id_seq OWNED BY public.account_activiti -- --- Name: accounts; Type: TABLE; Schema: public; Owner: - +-- Name: accounts; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.accounts ( @@ -271,7 +287,7 @@ ALTER SEQUENCE public.accounts_id_seq OWNED BY public.accounts.id; -- --- Name: actions; Type: TABLE; Schema: public; Owner: - +-- Name: actions; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.actions ( @@ -303,7 +319,7 @@ ALTER SEQUENCE public.actions_id_seq OWNED BY public.actions.id; -- --- Name: ar_internal_metadata; Type: TABLE; Schema: public; Owner: - +-- Name: ar_internal_metadata; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.ar_internal_metadata ( @@ -315,7 +331,7 @@ CREATE TABLE public.ar_internal_metadata ( -- --- Name: auctions; Type: TABLE; Schema: public; Owner: - +-- Name: auctions; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.auctions ( @@ -349,7 +365,7 @@ ALTER SEQUENCE public.auctions_id_seq OWNED BY public.auctions.id; -- --- Name: bank_statements; Type: TABLE; Schema: public; Owner: - +-- Name: bank_statements; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.bank_statements ( @@ -384,7 +400,7 @@ ALTER SEQUENCE public.bank_statements_id_seq OWNED BY public.bank_statements.id; -- --- Name: bank_transactions; Type: TABLE; Schema: public; Owner: - +-- Name: bank_transactions; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.bank_transactions ( @@ -428,7 +444,7 @@ ALTER SEQUENCE public.bank_transactions_id_seq OWNED BY public.bank_transactions -- --- Name: blocked_domains; Type: TABLE; Schema: public; Owner: - +-- Name: blocked_domains; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.blocked_domains ( @@ -461,7 +477,7 @@ ALTER SEQUENCE public.blocked_domains_id_seq OWNED BY public.blocked_domains.id; -- --- Name: bounced_mail_addresses; Type: TABLE; Schema: public; Owner: - +-- Name: bounced_mail_addresses; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.bounced_mail_addresses ( @@ -498,7 +514,7 @@ ALTER SEQUENCE public.bounced_mail_addresses_id_seq OWNED BY public.bounced_mail -- --- Name: certificates; Type: TABLE; Schema: public; Owner: - +-- Name: certificates; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.certificates ( @@ -537,7 +553,7 @@ ALTER SEQUENCE public.certificates_id_seq OWNED BY public.certificates.id; -- --- Name: contacts; Type: TABLE; Schema: public; Owner: - +-- Name: contacts; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.contacts ( @@ -595,42 +611,7 @@ ALTER SEQUENCE public.contacts_id_seq OWNED BY public.contacts.id; -- --- Name: csync_records; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.csync_records ( - id bigint NOT NULL, - domain_id bigint NOT NULL, - cdnskey character varying NOT NULL, - action character varying NOT NULL, - times_scanned integer DEFAULT 0 NOT NULL, - last_scan timestamp without time zone NOT NULL, - created_at timestamp(6) without time zone NOT NULL, - updated_at timestamp(6) without time zone NOT NULL -); - - --- --- Name: csync_records_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.csync_records_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: csync_records_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.csync_records_id_seq OWNED BY public.csync_records.id; - - --- --- Name: data_migrations; Type: TABLE; Schema: public; Owner: - +-- Name: data_migrations; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.data_migrations ( @@ -639,7 +620,7 @@ CREATE TABLE public.data_migrations ( -- --- Name: directos; Type: TABLE; Schema: public; Owner: - +-- Name: directos; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.directos ( @@ -674,7 +655,7 @@ ALTER SEQUENCE public.directos_id_seq OWNED BY public.directos.id; -- --- Name: disputes; Type: TABLE; Schema: public; Owner: - +-- Name: disputes; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.disputes ( @@ -711,7 +692,7 @@ ALTER SEQUENCE public.disputes_id_seq OWNED BY public.disputes.id; -- --- Name: dnskeys; Type: TABLE; Schema: public; Owner: - +-- Name: dnskeys; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.dnskeys ( @@ -752,7 +733,7 @@ ALTER SEQUENCE public.dnskeys_id_seq OWNED BY public.dnskeys.id; -- --- Name: domain_contacts; Type: TABLE; Schema: public; Owner: - +-- Name: domain_contacts; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.domain_contacts ( @@ -790,7 +771,7 @@ ALTER SEQUENCE public.domain_contacts_id_seq OWNED BY public.domain_contacts.id; -- --- Name: domain_transfers; Type: TABLE; Schema: public; Owner: - +-- Name: domain_transfers; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.domain_transfers ( @@ -827,7 +808,7 @@ ALTER SEQUENCE public.domain_transfers_id_seq OWNED BY public.domain_transfers.i -- --- Name: domains; Type: TABLE; Schema: public; Owner: - +-- Name: domains; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.domains ( @@ -887,7 +868,7 @@ ALTER SEQUENCE public.domains_id_seq OWNED BY public.domains.id; -- --- Name: email_address_verifications; Type: TABLE; Schema: public; Owner: - +-- Name: email_address_verifications; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.email_address_verifications ( @@ -919,7 +900,7 @@ ALTER SEQUENCE public.email_address_verifications_id_seq OWNED BY public.email_a -- --- Name: email_addresses_validations; Type: TABLE; Schema: public; Owner: - +-- Name: email_addresses_validations; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.email_addresses_validations ( @@ -949,7 +930,7 @@ ALTER SEQUENCE public.email_addresses_validations_id_seq OWNED BY public.email_a -- --- Name: email_addresses_verifications; Type: TABLE; Schema: public; Owner: - +-- Name: email_addresses_verifications; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.email_addresses_verifications ( @@ -979,7 +960,7 @@ ALTER SEQUENCE public.email_addresses_verifications_id_seq OWNED BY public.email -- --- Name: epp_sessions; Type: TABLE; Schema: public; Owner: - +-- Name: epp_sessions; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.epp_sessions ( @@ -1011,7 +992,7 @@ ALTER SEQUENCE public.epp_sessions_id_seq OWNED BY public.epp_sessions.id; -- --- Name: invoice_items; Type: TABLE; Schema: public; Owner: - +-- Name: invoice_items; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.invoice_items ( @@ -1049,7 +1030,7 @@ ALTER SEQUENCE public.invoice_items_id_seq OWNED BY public.invoice_items.id; -- --- Name: invoices; Type: TABLE; Schema: public; Owner: - +-- Name: invoices; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.invoices ( @@ -1120,7 +1101,7 @@ ALTER SEQUENCE public.invoices_id_seq OWNED BY public.invoices.id; -- --- Name: legal_documents; Type: TABLE; Schema: public; Owner: - +-- Name: legal_documents; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.legal_documents ( @@ -1155,7 +1136,7 @@ ALTER SEQUENCE public.legal_documents_id_seq OWNED BY public.legal_documents.id; -- --- Name: log_account_activities; Type: TABLE; Schema: public; Owner: - +-- Name: log_account_activities; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_account_activities ( @@ -1193,7 +1174,7 @@ ALTER SEQUENCE public.log_account_activities_id_seq OWNED BY public.log_account_ -- --- Name: log_accounts; Type: TABLE; Schema: public; Owner: - +-- Name: log_accounts; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_accounts ( @@ -1231,7 +1212,7 @@ ALTER SEQUENCE public.log_accounts_id_seq OWNED BY public.log_accounts.id; -- --- Name: log_actions; Type: TABLE; Schema: public; Owner: - +-- Name: log_actions; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_actions ( @@ -1269,7 +1250,7 @@ ALTER SEQUENCE public.log_actions_id_seq OWNED BY public.log_actions.id; -- --- Name: log_bank_statements; Type: TABLE; Schema: public; Owner: - +-- Name: log_bank_statements; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_bank_statements ( @@ -1307,7 +1288,7 @@ ALTER SEQUENCE public.log_bank_statements_id_seq OWNED BY public.log_bank_statem -- --- Name: log_bank_transactions; Type: TABLE; Schema: public; Owner: - +-- Name: log_bank_transactions; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_bank_transactions ( @@ -1345,7 +1326,7 @@ ALTER SEQUENCE public.log_bank_transactions_id_seq OWNED BY public.log_bank_tran -- --- Name: log_blocked_domains; Type: TABLE; Schema: public; Owner: - +-- Name: log_blocked_domains; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_blocked_domains ( @@ -1383,7 +1364,7 @@ ALTER SEQUENCE public.log_blocked_domains_id_seq OWNED BY public.log_blocked_dom -- --- Name: log_certificates; Type: TABLE; Schema: public; Owner: - +-- Name: log_certificates; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_certificates ( @@ -1421,7 +1402,7 @@ ALTER SEQUENCE public.log_certificates_id_seq OWNED BY public.log_certificates.i -- --- Name: log_contacts; Type: TABLE; Schema: public; Owner: - +-- Name: log_contacts; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_contacts ( @@ -1460,7 +1441,7 @@ ALTER SEQUENCE public.log_contacts_id_seq OWNED BY public.log_contacts.id; -- --- Name: log_dnskeys; Type: TABLE; Schema: public; Owner: - +-- Name: log_dnskeys; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_dnskeys ( @@ -1498,7 +1479,7 @@ ALTER SEQUENCE public.log_dnskeys_id_seq OWNED BY public.log_dnskeys.id; -- --- Name: log_domain_contacts; Type: TABLE; Schema: public; Owner: - +-- Name: log_domain_contacts; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_domain_contacts ( @@ -1536,7 +1517,7 @@ ALTER SEQUENCE public.log_domain_contacts_id_seq OWNED BY public.log_domain_cont -- --- Name: log_domains; Type: TABLE; Schema: public; Owner: - +-- Name: log_domains; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_domains ( @@ -1574,7 +1555,7 @@ ALTER SEQUENCE public.log_domains_id_seq OWNED BY public.log_domains.id; -- --- Name: log_invoice_items; Type: TABLE; Schema: public; Owner: - +-- Name: log_invoice_items; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_invoice_items ( @@ -1612,7 +1593,7 @@ ALTER SEQUENCE public.log_invoice_items_id_seq OWNED BY public.log_invoice_items -- --- Name: log_invoices; Type: TABLE; Schema: public; Owner: - +-- Name: log_invoices; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_invoices ( @@ -1650,7 +1631,7 @@ ALTER SEQUENCE public.log_invoices_id_seq OWNED BY public.log_invoices.id; -- --- Name: log_nameservers; Type: TABLE; Schema: public; Owner: - +-- Name: log_nameservers; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_nameservers ( @@ -1688,7 +1669,7 @@ ALTER SEQUENCE public.log_nameservers_id_seq OWNED BY public.log_nameservers.id; -- --- Name: log_notifications; Type: TABLE; Schema: public; Owner: - +-- Name: log_notifications; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_notifications ( @@ -1726,7 +1707,7 @@ ALTER SEQUENCE public.log_notifications_id_seq OWNED BY public.log_notifications -- --- Name: log_payment_orders; Type: TABLE; Schema: public; Owner: - +-- Name: log_payment_orders; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_payment_orders ( @@ -1839,7 +1820,7 @@ ALTER SEQUENCE public.log_registrant_verifications_id_seq OWNED BY public.log_re -- --- Name: log_registrars; Type: TABLE; Schema: public; Owner: - +-- Name: log_registrars; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_registrars ( @@ -1877,7 +1858,7 @@ ALTER SEQUENCE public.log_registrars_id_seq OWNED BY public.log_registrars.id; -- --- Name: log_reserved_domains; Type: TABLE; Schema: public; Owner: - +-- Name: log_reserved_domains; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_reserved_domains ( @@ -1915,7 +1896,7 @@ ALTER SEQUENCE public.log_reserved_domains_id_seq OWNED BY public.log_reserved_d -- --- Name: log_setting_entries; Type: TABLE; Schema: public; Owner: - +-- Name: log_setting_entries; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_setting_entries ( @@ -1953,7 +1934,7 @@ ALTER SEQUENCE public.log_setting_entries_id_seq OWNED BY public.log_setting_ent -- --- Name: log_settings; Type: TABLE; Schema: public; Owner: - +-- Name: log_settings; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_settings ( @@ -1991,7 +1972,7 @@ ALTER SEQUENCE public.log_settings_id_seq OWNED BY public.log_settings.id; -- --- Name: log_users; Type: TABLE; Schema: public; Owner: - +-- Name: log_users; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_users ( @@ -2008,6 +1989,40 @@ CREATE TABLE public.log_users ( uuid character varying ); +-- +-- Name: csync_records; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.csync_records ( + id bigint NOT NULL, + domain_id bigint NOT NULL, + cdnskey character varying NOT NULL, + action character varying NOT NULL, + times_scanned integer DEFAULT 0 NOT NULL, + last_scan timestamp without time zone NOT NULL, + created_at timestamp(6) without time zone NOT NULL, + updated_at timestamp(6) without time zone NOT NULL +); + + +-- +-- Name: csync_records_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.csync_records_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: csync_records_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.csync_records_id_seq OWNED BY public.csync_records.id; + -- -- Name: log_users_id_seq; Type: SEQUENCE; Schema: public; Owner: - @@ -2029,7 +2044,7 @@ ALTER SEQUENCE public.log_users_id_seq OWNED BY public.log_users.id; -- --- Name: log_white_ips; Type: TABLE; Schema: public; Owner: - +-- Name: log_white_ips; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_white_ips ( @@ -2067,7 +2082,7 @@ ALTER SEQUENCE public.log_white_ips_id_seq OWNED BY public.log_white_ips.id; -- --- Name: nameservers; Type: TABLE; Schema: public; Owner: - +-- Name: nameservers; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.nameservers ( @@ -2105,7 +2120,7 @@ ALTER SEQUENCE public.nameservers_id_seq OWNED BY public.nameservers.id; -- --- Name: notifications; Type: TABLE; Schema: public; Owner: - +-- Name: notifications; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.notifications ( @@ -2143,7 +2158,7 @@ ALTER SEQUENCE public.notifications_id_seq OWNED BY public.notifications.id; -- --- Name: payment_orders; Type: TABLE; Schema: public; Owner: - +-- Name: payment_orders; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.payment_orders ( @@ -2180,7 +2195,7 @@ ALTER SEQUENCE public.payment_orders_id_seq OWNED BY public.payment_orders.id; -- --- Name: prices; Type: TABLE; Schema: public; Owner: - +-- Name: prices; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.prices ( @@ -2218,7 +2233,7 @@ ALTER SEQUENCE public.prices_id_seq OWNED BY public.prices.id; -- --- Name: que_jobs; Type: TABLE; Schema: public; Owner: - +-- Name: que_jobs; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.que_jobs ( @@ -2260,7 +2275,7 @@ ALTER SEQUENCE public.que_jobs_job_id_seq OWNED BY public.que_jobs.job_id; -- --- Name: registrant_verifications; Type: TABLE; Schema: public; Owner: - +-- Name: registrant_verifications; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.registrant_verifications ( @@ -2271,6 +2286,12 @@ CREATE TABLE public.registrant_verifications ( action character varying NOT NULL, domain_id integer NOT NULL, action_type character varying NOT NULL, + creator_id integer, + updater_id integer, + session character varying, + children json, + ident_updated_at timestamp without time zone, + uuid character varying, creator_str character varying, updator_str character varying ); @@ -2296,7 +2317,7 @@ ALTER SEQUENCE public.registrant_verifications_id_seq OWNED BY public.registrant -- --- Name: registrars; Type: TABLE; Schema: public; Owner: - +-- Name: registrars; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.registrars ( @@ -2351,7 +2372,7 @@ ALTER SEQUENCE public.registrars_id_seq OWNED BY public.registrars.id; -- --- Name: reserved_domains; Type: TABLE; Schema: public; Owner: - +-- Name: reserved_domains; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.reserved_domains ( @@ -2386,7 +2407,7 @@ ALTER SEQUENCE public.reserved_domains_id_seq OWNED BY public.reserved_domains.i -- --- Name: schema_migrations; Type: TABLE; Schema: public; Owner: - +-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.schema_migrations ( @@ -2395,7 +2416,7 @@ CREATE TABLE public.schema_migrations ( -- --- Name: setting_entries; Type: TABLE; Schema: public; Owner: - +-- Name: setting_entries; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.setting_entries ( @@ -2431,7 +2452,7 @@ ALTER SEQUENCE public.setting_entries_id_seq OWNED BY public.setting_entries.id; -- --- Name: settings; Type: TABLE; Schema: public; Owner: - +-- Name: settings; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.settings ( @@ -2467,7 +2488,7 @@ ALTER SEQUENCE public.settings_id_seq OWNED BY public.settings.id; -- --- Name: users; Type: TABLE; Schema: public; Owner: - +-- Name: users; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.users ( @@ -2519,7 +2540,7 @@ ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id; -- --- Name: versions; Type: TABLE; Schema: public; Owner: - +-- Name: versions; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.versions ( @@ -2554,7 +2575,7 @@ ALTER SEQUENCE public.versions_id_seq OWNED BY public.versions.id; -- --- Name: white_ips; Type: TABLE; Schema: public; Owner: - +-- Name: white_ips; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.white_ips ( @@ -2590,7 +2611,7 @@ ALTER SEQUENCE public.white_ips_id_seq OWNED BY public.white_ips.id; -- --- Name: whois_records; Type: TABLE; Schema: public; Owner: - +-- Name: whois_records; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.whois_records ( @@ -2625,7 +2646,7 @@ ALTER SEQUENCE public.whois_records_id_seq OWNED BY public.whois_records.id; -- --- Name: zones; Type: TABLE; Schema: public; Owner: - +-- Name: zones; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.zones ( @@ -2668,154 +2689,460 @@ ALTER SEQUENCE public.zones_id_seq OWNED BY public.zones.id; -- --- Name: account_activities id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.account_activities ALTER COLUMN id SET DEFAULT nextval('public.account_activities_id_seq'::regclass); -- --- Name: accounts id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.accounts ALTER COLUMN id SET DEFAULT nextval('public.accounts_id_seq'::regclass); -- --- Name: actions id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.actions ALTER COLUMN id SET DEFAULT nextval('public.actions_id_seq'::regclass); -- --- Name: auctions id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.auctions ALTER COLUMN id SET DEFAULT nextval('public.auctions_id_seq'::regclass); -- --- Name: bank_statements id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.bank_statements ALTER COLUMN id SET DEFAULT nextval('public.bank_statements_id_seq'::regclass); -- --- Name: bank_transactions id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.bank_transactions ALTER COLUMN id SET DEFAULT nextval('public.bank_transactions_id_seq'::regclass); -- --- Name: blocked_domains id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.blocked_domains ALTER COLUMN id SET DEFAULT nextval('public.blocked_domains_id_seq'::regclass); -- --- Name: bounced_mail_addresses id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.bounced_mail_addresses ALTER COLUMN id SET DEFAULT nextval('public.bounced_mail_addresses_id_seq'::regclass); -- --- Name: certificates id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.certificates ALTER COLUMN id SET DEFAULT nextval('public.certificates_id_seq'::regclass); -- --- Name: contacts id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.contacts ALTER COLUMN id SET DEFAULT nextval('public.contacts_id_seq'::regclass); -- --- Name: csync_records id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.csync_records ALTER COLUMN id SET DEFAULT nextval('public.csync_records_id_seq'::regclass); - - --- --- Name: directos id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.directos ALTER COLUMN id SET DEFAULT nextval('public.directos_id_seq'::regclass); -- --- Name: disputes id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.disputes ALTER COLUMN id SET DEFAULT nextval('public.disputes_id_seq'::regclass); -- --- Name: dnskeys id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.dnskeys ALTER COLUMN id SET DEFAULT nextval('public.dnskeys_id_seq'::regclass); -- --- Name: domain_contacts id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_contacts ALTER COLUMN id SET DEFAULT nextval('public.domain_contacts_id_seq'::regclass); -- --- Name: domain_transfers id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_transfers ALTER COLUMN id SET DEFAULT nextval('public.domain_transfers_id_seq'::regclass); -- --- Name: domains id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- 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: - +-- Name: 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: - +-- Name: 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: - +-- Name: 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: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.epp_sessions ALTER COLUMN id SET DEFAULT nextval('public.epp_sessions_id_seq'::regclass); -- --- Name: invoice_items id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.invoice_items ALTER COLUMN id SET DEFAULT nextval('public.invoice_items_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.invoices ALTER COLUMN id SET DEFAULT nextval('public.invoices_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.legal_documents ALTER COLUMN id SET DEFAULT nextval('public.legal_documents_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_account_activities ALTER COLUMN id SET DEFAULT nextval('public.log_account_activities_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_accounts ALTER COLUMN id SET DEFAULT nextval('public.log_accounts_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_actions ALTER COLUMN id SET DEFAULT nextval('public.log_actions_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_bank_statements ALTER COLUMN id SET DEFAULT nextval('public.log_bank_statements_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_bank_transactions ALTER COLUMN id SET DEFAULT nextval('public.log_bank_transactions_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_blocked_domains ALTER COLUMN id SET DEFAULT nextval('public.log_blocked_domains_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_certificates ALTER COLUMN id SET DEFAULT nextval('public.log_certificates_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_contacts ALTER COLUMN id SET DEFAULT nextval('public.log_contacts_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_dnskeys ALTER COLUMN id SET DEFAULT nextval('public.log_dnskeys_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_domain_contacts ALTER COLUMN id SET DEFAULT nextval('public.log_domain_contacts_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_domains ALTER COLUMN id SET DEFAULT nextval('public.log_domains_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_invoice_items ALTER COLUMN id SET DEFAULT nextval('public.log_invoice_items_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_invoices ALTER COLUMN id SET DEFAULT nextval('public.log_invoices_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_nameservers ALTER COLUMN id SET DEFAULT nextval('public.log_nameservers_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_notifications ALTER COLUMN id SET DEFAULT nextval('public.log_notifications_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_payment_orders ALTER COLUMN id SET DEFAULT nextval('public.log_payment_orders_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_prices ALTER COLUMN id SET DEFAULT nextval('public.log_prices_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_registrant_verifications ALTER COLUMN id SET DEFAULT nextval('public.log_registrant_verifications_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_registrars ALTER COLUMN id SET DEFAULT nextval('public.log_registrars_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_reserved_domains ALTER COLUMN id SET DEFAULT nextval('public.log_reserved_domains_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_setting_entries ALTER COLUMN id SET DEFAULT nextval('public.log_setting_entries_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_settings ALTER COLUMN id SET DEFAULT nextval('public.log_settings_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_users ALTER COLUMN id SET DEFAULT nextval('public.log_users_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.log_white_ips ALTER COLUMN id SET DEFAULT nextval('public.log_white_ips_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.nameservers ALTER COLUMN id SET DEFAULT nextval('public.nameservers_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.notifications ALTER COLUMN id SET DEFAULT nextval('public.notifications_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.payment_orders ALTER COLUMN id SET DEFAULT nextval('public.payment_orders_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.prices ALTER COLUMN id SET DEFAULT nextval('public.prices_id_seq'::regclass); + + +-- +-- Name: 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: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.registrant_verifications ALTER COLUMN id SET DEFAULT nextval('public.registrant_verifications_id_seq'::regclass); + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.accounts ALTER COLUMN id SET DEFAULT nextval('public.accounts_id_seq'::regclass); + + +ALTER TABLE ONLY public.log_invoices + ADD CONSTRAINT log_invoices_pkey PRIMARY KEY (id); + + +ALTER TABLE ONLY public.registrars ALTER COLUMN id SET DEFAULT nextval('public.registrars_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- +ALTER TABLE ONLY public.disputes ALTER COLUMN id SET DEFAULT nextval('public.disputes_id_seq'::regclass); + +ALTER TABLE ONLY public.log_nameservers + ADD CONSTRAINT log_nameservers_pkey PRIMARY KEY (id); + + +ALTER TABLE ONLY public.reserved_domains ALTER COLUMN id SET DEFAULT nextval('public.reserved_domains_id_seq'::regclass); + + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.setting_entries ALTER COLUMN id SET DEFAULT nextval('public.setting_entries_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.setting_entries ALTER COLUMN id SET DEFAULT nextval('public.setting_entries_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.settings ALTER COLUMN id SET DEFAULT nextval('public.settings_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.domains ALTER COLUMN id SET DEFAULT nextval('public.domains_id_seq'::regclass); + + +-- +-- Name: versions 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: white_ips 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: whois_records 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: zones id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.epp_sessions ALTER COLUMN id SET DEFAULT nextval('public.epp_sessions_id_seq'::regclass); + + +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.invoice_items ALTER COLUMN id SET DEFAULT nextval('public.invoice_items_id_seq'::regclass); @@ -2947,13 +3274,6 @@ ALTER TABLE ONLY public.log_notifications ALTER COLUMN id SET DEFAULT nextval('p ALTER TABLE ONLY public.log_payment_orders ALTER COLUMN id SET DEFAULT nextval('public.log_payment_orders_id_seq'::regclass); --- --- Name: log_prices id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_prices ALTER COLUMN id SET DEFAULT nextval('public.log_prices_id_seq'::regclass); - - -- -- Name: log_registrant_verifications id; Type: DEFAULT; Schema: public; Owner: - -- @@ -2975,13 +3295,6 @@ ALTER TABLE ONLY public.log_registrars ALTER COLUMN id SET DEFAULT nextval('publ ALTER TABLE ONLY public.log_reserved_domains ALTER COLUMN id SET DEFAULT nextval('public.log_reserved_domains_id_seq'::regclass); --- --- Name: log_setting_entries id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_setting_entries ALTER COLUMN id SET DEFAULT nextval('public.log_setting_entries_id_seq'::regclass); - - -- -- Name: log_settings id; Type: DEFAULT; Schema: public; Owner: - -- @@ -3059,13 +3372,6 @@ ALTER TABLE ONLY public.registrars ALTER COLUMN id SET DEFAULT nextval('public.r ALTER TABLE ONLY public.reserved_domains ALTER COLUMN id SET DEFAULT nextval('public.reserved_domains_id_seq'::regclass); --- --- Name: setting_entries id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.setting_entries ALTER COLUMN id SET DEFAULT nextval('public.setting_entries_id_seq'::regclass); - - -- -- Name: settings id; Type: DEFAULT; Schema: public; Owner: - -- @@ -3079,37 +3385,43 @@ ALTER TABLE ONLY public.settings ALTER COLUMN id SET DEFAULT nextval('public.set ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass); +ALTER TABLE ONLY public.log_prices + ADD CONSTRAINT log_prices_pkey PRIMARY KEY (id); + + +ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass); + -- --- Name: versions id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.versions ALTER COLUMN id SET DEFAULT nextval('public.versions_id_seq'::regclass); -- --- Name: white_ips id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.white_ips ALTER COLUMN id SET DEFAULT nextval('public.white_ips_id_seq'::regclass); -- --- Name: whois_records id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.whois_records ALTER COLUMN id SET DEFAULT nextval('public.whois_records_id_seq'::regclass); -- --- Name: zones id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.zones ALTER COLUMN id SET DEFAULT nextval('public.zones_id_seq'::regclass); -- --- Name: account_activities account_activities_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: account_activities_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.account_activities @@ -3117,7 +3429,7 @@ ALTER TABLE ONLY public.account_activities -- --- Name: accounts accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.accounts @@ -3125,7 +3437,7 @@ ALTER TABLE ONLY public.accounts -- --- Name: actions actions_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: actions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.actions @@ -3133,7 +3445,7 @@ ALTER TABLE ONLY public.actions -- --- Name: ar_internal_metadata ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.ar_internal_metadata @@ -3141,7 +3453,7 @@ ALTER TABLE ONLY public.ar_internal_metadata -- --- Name: auctions auctions_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: auctions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.auctions @@ -3149,7 +3461,7 @@ ALTER TABLE ONLY public.auctions -- --- Name: bank_statements bank_statements_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: bank_statements_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.bank_statements @@ -3157,7 +3469,7 @@ ALTER TABLE ONLY public.bank_statements -- --- Name: bank_transactions bank_transactions_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: bank_transactions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.bank_transactions @@ -3165,7 +3477,7 @@ ALTER TABLE ONLY public.bank_transactions -- --- Name: blocked_domains blocked_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: blocked_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.blocked_domains @@ -3173,7 +3485,7 @@ ALTER TABLE ONLY public.blocked_domains -- --- Name: bounced_mail_addresses bounced_mail_addresses_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: bounced_mail_addresses_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.bounced_mail_addresses @@ -3181,7 +3493,7 @@ ALTER TABLE ONLY public.bounced_mail_addresses -- --- Name: certificates certificates_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: certificates_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.certificates @@ -3189,7 +3501,7 @@ ALTER TABLE ONLY public.certificates -- --- Name: contacts contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.contacts @@ -3197,15 +3509,7 @@ ALTER TABLE ONLY public.contacts -- --- Name: csync_records csync_records_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.csync_records - ADD CONSTRAINT csync_records_pkey PRIMARY KEY (id); - - --- --- Name: directos directos_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: directos_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.directos @@ -3213,7 +3517,7 @@ ALTER TABLE ONLY public.directos -- --- Name: disputes disputes_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: disputes_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.disputes @@ -3221,7 +3525,7 @@ ALTER TABLE ONLY public.disputes -- --- Name: dnskeys dnskeys_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: dnskeys_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.dnskeys @@ -3229,7 +3533,7 @@ ALTER TABLE ONLY public.dnskeys -- --- Name: domain_contacts domain_contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: domain_contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.domain_contacts @@ -3237,7 +3541,7 @@ ALTER TABLE ONLY public.domain_contacts -- --- Name: domain_transfers domain_transfers_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: domain_transfers_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.domain_transfers @@ -3245,7 +3549,7 @@ ALTER TABLE ONLY public.domain_transfers -- --- Name: domains domains_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.domains @@ -3253,7 +3557,7 @@ ALTER TABLE ONLY public.domains -- --- Name: email_address_verifications email_address_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: email_address_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.email_address_verifications @@ -3261,7 +3565,7 @@ ALTER TABLE ONLY public.email_address_verifications -- --- Name: email_addresses_validations email_addresses_validations_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: email_addresses_validations_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.email_addresses_validations @@ -3269,7 +3573,7 @@ ALTER TABLE ONLY public.email_addresses_validations -- --- Name: email_addresses_verifications email_addresses_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: email_addresses_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.email_addresses_verifications @@ -3277,7 +3581,7 @@ ALTER TABLE ONLY public.email_addresses_verifications -- --- Name: epp_sessions epp_sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: epp_sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.epp_sessions @@ -3285,7 +3589,7 @@ ALTER TABLE ONLY public.epp_sessions -- --- Name: invoice_items invoice_items_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: invoice_items_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.invoice_items @@ -3293,7 +3597,7 @@ ALTER TABLE ONLY public.invoice_items -- --- Name: invoices invoices_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: invoices_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.invoices @@ -3301,7 +3605,7 @@ ALTER TABLE ONLY public.invoices -- --- Name: legal_documents legal_documents_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: legal_documents_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.legal_documents @@ -3309,7 +3613,7 @@ ALTER TABLE ONLY public.legal_documents -- --- Name: log_account_activities log_account_activities_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_account_activities_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_account_activities @@ -3317,7 +3621,7 @@ ALTER TABLE ONLY public.log_account_activities -- --- Name: log_accounts log_accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_accounts @@ -3325,7 +3629,7 @@ ALTER TABLE ONLY public.log_accounts -- --- Name: log_actions log_actions_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_actions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_actions @@ -3333,7 +3637,7 @@ ALTER TABLE ONLY public.log_actions -- --- Name: log_bank_statements log_bank_statements_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_bank_statements_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_bank_statements @@ -3341,7 +3645,7 @@ ALTER TABLE ONLY public.log_bank_statements -- --- Name: log_bank_transactions log_bank_transactions_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_bank_transactions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_bank_transactions @@ -3349,7 +3653,7 @@ ALTER TABLE ONLY public.log_bank_transactions -- --- Name: log_blocked_domains log_blocked_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_blocked_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_blocked_domains @@ -3357,7 +3661,7 @@ ALTER TABLE ONLY public.log_blocked_domains -- --- Name: log_certificates log_certificates_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_certificates_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_certificates @@ -3365,7 +3669,7 @@ ALTER TABLE ONLY public.log_certificates -- --- Name: log_contacts log_contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_contacts @@ -3373,7 +3677,7 @@ ALTER TABLE ONLY public.log_contacts -- --- Name: log_dnskeys log_dnskeys_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_dnskeys_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_dnskeys @@ -3381,7 +3685,7 @@ ALTER TABLE ONLY public.log_dnskeys -- --- Name: log_domain_contacts log_domain_contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_domain_contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_domain_contacts @@ -3389,7 +3693,7 @@ ALTER TABLE ONLY public.log_domain_contacts -- --- Name: log_domains log_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_domains @@ -3397,7 +3701,7 @@ ALTER TABLE ONLY public.log_domains -- --- Name: log_invoice_items log_invoice_items_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_invoice_items_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_invoice_items @@ -3405,23 +3709,7 @@ ALTER TABLE ONLY public.log_invoice_items -- --- Name: log_invoices log_invoices_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_invoices - ADD CONSTRAINT log_invoices_pkey PRIMARY KEY (id); - - --- --- Name: log_nameservers log_nameservers_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_nameservers - ADD CONSTRAINT log_nameservers_pkey PRIMARY KEY (id); - - --- --- Name: log_notifications log_notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_notifications @@ -3429,7 +3717,7 @@ ALTER TABLE ONLY public.log_notifications -- --- Name: log_payment_orders log_payment_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_payment_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_payment_orders @@ -3437,15 +3725,7 @@ ALTER TABLE ONLY public.log_payment_orders -- --- Name: log_prices log_prices_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.log_prices - ADD CONSTRAINT log_prices_pkey PRIMARY KEY (id); - - --- --- Name: log_registrant_verifications log_registrant_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_registrant_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_registrant_verifications @@ -3453,7 +3733,7 @@ ALTER TABLE ONLY public.log_registrant_verifications -- --- Name: log_registrars log_registrars_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_registrars_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_registrars @@ -3461,7 +3741,7 @@ ALTER TABLE ONLY public.log_registrars -- --- Name: log_reserved_domains log_reserved_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_reserved_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_reserved_domains @@ -3469,7 +3749,7 @@ ALTER TABLE ONLY public.log_reserved_domains -- --- Name: log_setting_entries log_setting_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_setting_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_setting_entries @@ -3477,7 +3757,7 @@ ALTER TABLE ONLY public.log_setting_entries -- --- Name: log_settings log_settings_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_settings_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_settings @@ -3485,7 +3765,7 @@ ALTER TABLE ONLY public.log_settings -- --- Name: log_users log_users_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_users_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_users @@ -3493,7 +3773,7 @@ ALTER TABLE ONLY public.log_users -- --- Name: log_white_ips log_white_ips_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_white_ips_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_white_ips @@ -3501,7 +3781,7 @@ ALTER TABLE ONLY public.log_white_ips -- --- Name: nameservers nameservers_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: nameservers_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.nameservers @@ -3509,7 +3789,7 @@ ALTER TABLE ONLY public.nameservers -- --- Name: notifications notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.notifications @@ -3517,7 +3797,7 @@ ALTER TABLE ONLY public.notifications -- --- Name: payment_orders payment_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: payment_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.payment_orders @@ -3525,7 +3805,7 @@ ALTER TABLE ONLY public.payment_orders -- --- Name: prices prices_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: prices_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.prices @@ -3533,7 +3813,7 @@ ALTER TABLE ONLY public.prices -- --- Name: que_jobs que_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: que_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.que_jobs @@ -3541,7 +3821,7 @@ ALTER TABLE ONLY public.que_jobs -- --- Name: registrant_verifications registrant_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: registrant_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.registrant_verifications @@ -3549,7 +3829,7 @@ ALTER TABLE ONLY public.registrant_verifications -- --- Name: registrars registrars_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: registrars_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.registrars @@ -3557,7 +3837,7 @@ ALTER TABLE ONLY public.registrars -- --- Name: reserved_domains reserved_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: reserved_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.reserved_domains @@ -3565,7 +3845,7 @@ ALTER TABLE ONLY public.reserved_domains -- --- Name: setting_entries setting_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: setting_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.setting_entries @@ -3573,7 +3853,7 @@ ALTER TABLE ONLY public.setting_entries -- --- Name: settings settings_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: settings_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.settings @@ -3581,7 +3861,7 @@ ALTER TABLE ONLY public.settings -- --- Name: blocked_domains uniq_blocked_domains_name; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: uniq_blocked_domains_name; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.blocked_domains @@ -3589,7 +3869,7 @@ ALTER TABLE ONLY public.blocked_domains -- --- Name: domain_contacts uniq_contact_of_type_per_domain; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: uniq_contact_of_type_per_domain; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.domain_contacts @@ -3597,7 +3877,7 @@ ALTER TABLE ONLY public.domain_contacts -- --- Name: contacts uniq_contact_uuid; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: uniq_contact_uuid; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.contacts @@ -3605,7 +3885,7 @@ ALTER TABLE ONLY public.contacts -- --- Name: domains uniq_domain_uuid; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: uniq_domain_uuid; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.domains @@ -3613,7 +3893,7 @@ ALTER TABLE ONLY public.domains -- --- Name: nameservers uniq_hostname_per_domain; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: uniq_hostname_per_domain; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.nameservers @@ -3621,7 +3901,7 @@ ALTER TABLE ONLY public.nameservers -- --- Name: reserved_domains uniq_reserved_domains_name; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: uniq_reserved_domains_name; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.reserved_domains @@ -3629,7 +3909,7 @@ ALTER TABLE ONLY public.reserved_domains -- --- Name: auctions uniq_uuid; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: uniq_uuid; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.auctions @@ -3637,7 +3917,7 @@ ALTER TABLE ONLY public.auctions -- --- Name: registrars unique_code; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: unique_code; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.registrars @@ -3645,7 +3925,7 @@ ALTER TABLE ONLY public.registrars -- --- Name: contacts unique_contact_code; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: unique_contact_code; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.contacts @@ -3653,7 +3933,7 @@ ALTER TABLE ONLY public.contacts -- --- Name: registrars unique_name; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: unique_name; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.registrars @@ -3661,7 +3941,7 @@ ALTER TABLE ONLY public.registrars -- --- Name: invoices unique_number; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: unique_number; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.invoices @@ -3669,7 +3949,7 @@ ALTER TABLE ONLY public.invoices -- --- Name: registrars unique_reference_no; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: unique_reference_no; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.registrars @@ -3677,7 +3957,7 @@ ALTER TABLE ONLY public.registrars -- --- Name: auctions unique_registration_code; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: unique_registration_code; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.auctions @@ -3685,7 +3965,7 @@ ALTER TABLE ONLY public.auctions -- --- Name: epp_sessions unique_session_id; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: unique_session_id; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.epp_sessions @@ -3693,7 +3973,7 @@ ALTER TABLE ONLY public.epp_sessions -- --- Name: zones unique_zone_origin; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: unique_zone_origin; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.zones @@ -3701,7 +3981,7 @@ ALTER TABLE ONLY public.zones -- --- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.users @@ -3709,7 +3989,7 @@ ALTER TABLE ONLY public.users -- --- Name: versions versions_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.versions @@ -3717,7 +3997,7 @@ ALTER TABLE ONLY public.versions -- --- Name: white_ips white_ips_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: white_ips_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.white_ips @@ -3725,7 +4005,7 @@ ALTER TABLE ONLY public.white_ips -- --- Name: whois_records whois_records_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: whois_records_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.whois_records @@ -3733,7 +4013,7 @@ ALTER TABLE ONLY public.whois_records -- --- Name: zones zones_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: zones_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.zones @@ -3741,118 +4021,111 @@ ALTER TABLE ONLY public.zones -- --- Name: index_account_activities_on_account_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_account_activities_on_account_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_account_activities_on_account_id ON public.account_activities USING btree (account_id); -- --- Name: index_account_activities_on_bank_transaction_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_account_activities_on_bank_transaction_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_account_activities_on_bank_transaction_id ON public.account_activities USING btree (bank_transaction_id); -- --- Name: index_account_activities_on_invoice_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_account_activities_on_invoice_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_account_activities_on_invoice_id ON public.account_activities USING btree (invoice_id); -- --- Name: index_accounts_on_registrar_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_accounts_on_registrar_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_accounts_on_registrar_id ON public.accounts USING btree (registrar_id); -- --- Name: index_certificates_on_api_user_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_certificates_on_api_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_certificates_on_api_user_id ON public.certificates USING btree (api_user_id); -- --- Name: index_contacts_on_code; Type: INDEX; Schema: public; Owner: - +-- Name: index_contacts_on_code; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_contacts_on_code ON public.contacts USING btree (code); -- --- Name: index_contacts_on_registrar_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_contacts_on_registrar_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_contacts_on_registrar_id ON public.contacts USING btree (registrar_id); -- --- Name: index_contacts_on_registrar_id_and_ident_type; Type: INDEX; Schema: public; Owner: - +-- Name: index_contacts_on_registrar_id_and_ident_type; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_contacts_on_registrar_id_and_ident_type ON public.contacts USING btree (registrar_id, ident_type); -- --- Name: index_csync_records_on_domain_id; Type: INDEX; Schema: public; Owner: - --- - -CREATE UNIQUE INDEX index_csync_records_on_domain_id ON public.csync_records USING btree (domain_id); - - --- --- Name: index_directos_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_directos_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_directos_on_item_type_and_item_id ON public.directos USING btree (item_type, item_id); -- --- Name: index_dnskeys_on_domain_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_dnskeys_on_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_dnskeys_on_domain_id ON public.dnskeys USING btree (domain_id); -- --- Name: index_dnskeys_on_legacy_domain_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_dnskeys_on_legacy_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_dnskeys_on_legacy_domain_id ON public.dnskeys USING btree (legacy_domain_id); -- --- Name: index_domain_contacts_on_contact_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_domain_contacts_on_contact_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_domain_contacts_on_contact_id ON public.domain_contacts USING btree (contact_id); -- --- Name: index_domain_contacts_on_domain_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_domain_contacts_on_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_domain_contacts_on_domain_id ON public.domain_contacts USING btree (domain_id); -- --- Name: index_domain_transfers_on_domain_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_domain_transfers_on_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_domain_transfers_on_domain_id ON public.domain_transfers USING btree (domain_id); -- --- Name: index_domains_on_delete_date; Type: INDEX; Schema: public; Owner: - +-- Name: index_domains_on_delete_date; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_domains_on_delete_date ON public.domains USING btree (delete_date); --- + -- Name: index_domains_on_json_statuses_history; Type: INDEX; Schema: public; Owner: - -- @@ -3861,508 +4134,522 @@ CREATE INDEX index_domains_on_json_statuses_history ON public.domains USING gin -- -- Name: index_domains_on_name; Type: INDEX; Schema: public; Owner: - + + +-- +-- Name: index_domains_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE UNIQUE INDEX index_domains_on_name ON public.domains USING btree (name); -- --- Name: index_domains_on_outzone_at; Type: INDEX; Schema: public; Owner: - +-- Name: index_domains_on_outzone_at; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_domains_on_outzone_at ON public.domains USING btree (outzone_at); -- --- Name: index_domains_on_registrant_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_domains_on_registrant_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_domains_on_registrant_id ON public.domains USING btree (registrant_id); -- --- Name: index_domains_on_registrant_verification_asked_at; Type: INDEX; Schema: public; Owner: - +-- Name: index_domains_on_registrant_verification_asked_at; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_domains_on_registrant_verification_asked_at ON public.domains USING btree (registrant_verification_asked_at); -- --- Name: index_domains_on_registrant_verification_token; Type: INDEX; Schema: public; Owner: - +-- Name: index_domains_on_registrant_verification_token; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_domains_on_registrant_verification_token ON public.domains USING btree (registrant_verification_token); -- --- Name: index_domains_on_registrar_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_domains_on_registrar_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_domains_on_registrar_id ON public.domains USING btree (registrar_id); -- --- Name: index_domains_on_statuses; Type: INDEX; Schema: public; Owner: - +-- Name: index_domains_on_statuses; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_domains_on_statuses ON public.domains USING gin (statuses); -- --- Name: index_email_address_verifications_on_domain; Type: INDEX; Schema: public; Owner: - +-- Name: index_email_address_verifications_on_domain; Type: INDEX; Schema: public; Owner: -; Tablespace: -- 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: - +-- Name: index_epp_sessions_on_updated_at; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_epp_sessions_on_updated_at ON public.epp_sessions USING btree (updated_at); -- --- Name: index_invoice_items_on_invoice_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_invoice_items_on_invoice_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_invoice_items_on_invoice_id ON public.invoice_items USING btree (invoice_id); -- --- Name: index_invoices_on_buyer_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_invoices_on_buyer_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_invoices_on_buyer_id ON public.invoices USING btree (buyer_id); -- --- Name: index_legal_documents_on_checksum; Type: INDEX; Schema: public; Owner: - +-- Name: index_legal_documents_on_checksum; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_legal_documents_on_checksum ON public.legal_documents USING btree (checksum); -- --- Name: index_legal_documents_on_documentable_type_and_documentable_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_legal_documents_on_documentable_type_and_documentable_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_legal_documents_on_documentable_type_and_documentable_id ON public.legal_documents USING btree (documentable_type, documentable_id); -- --- Name: index_log_account_activities_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_account_activities_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_account_activities_on_item_type_and_item_id ON public.log_account_activities USING btree (item_type, item_id); -- --- Name: index_log_account_activities_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_account_activities_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_account_activities_on_whodunnit ON public.log_account_activities USING btree (whodunnit); -- --- Name: index_log_accounts_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_accounts_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_accounts_on_item_type_and_item_id ON public.log_accounts USING btree (item_type, item_id); -- --- Name: index_log_accounts_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_accounts_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_accounts_on_whodunnit ON public.log_accounts USING btree (whodunnit); -- --- Name: index_log_bank_statements_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_bank_statements_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_bank_statements_on_item_type_and_item_id ON public.log_bank_statements USING btree (item_type, item_id); -- --- Name: index_log_bank_statements_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_bank_statements_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_bank_statements_on_whodunnit ON public.log_bank_statements USING btree (whodunnit); -- --- Name: index_log_bank_transactions_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_bank_transactions_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_bank_transactions_on_item_type_and_item_id ON public.log_bank_transactions USING btree (item_type, item_id); -- --- Name: index_log_bank_transactions_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_bank_transactions_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_bank_transactions_on_whodunnit ON public.log_bank_transactions USING btree (whodunnit); -- --- Name: index_log_blocked_domains_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_blocked_domains_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_blocked_domains_on_item_type_and_item_id ON public.log_blocked_domains USING btree (item_type, item_id); -- --- Name: index_log_blocked_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_blocked_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_blocked_domains_on_whodunnit ON public.log_blocked_domains USING btree (whodunnit); -- --- Name: index_log_certificates_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_certificates_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_certificates_on_item_type_and_item_id ON public.log_certificates USING btree (item_type, item_id); -- --- Name: index_log_certificates_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_certificates_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_certificates_on_whodunnit ON public.log_certificates USING btree (whodunnit); -- --- Name: index_log_contacts_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_contacts_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_contacts_on_item_type_and_item_id ON public.log_contacts USING btree (item_type, item_id); -- --- Name: index_log_contacts_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_contacts_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_contacts_on_whodunnit ON public.log_contacts USING btree (whodunnit); -- --- Name: index_log_dnskeys_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_dnskeys_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_dnskeys_on_item_type_and_item_id ON public.log_dnskeys USING btree (item_type, item_id); -- --- Name: index_log_dnskeys_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: csync_records id; Type: DEFAULT; Schema: public; Owner: - +-- +ALTER TABLE ONLY public.csync_records ALTER COLUMN id SET DEFAULT nextval('public.csync_records_id_seq'::regclass); + +-- +-- Name: index_csync_records_on_domain_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE UNIQUE INDEX index_csync_records_on_domain_id ON public.csync_records USING btree (domain_id); + +-- +-- Name: index_log_dnskeys_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_dnskeys_on_whodunnit ON public.log_dnskeys USING btree (whodunnit); -- --- Name: index_log_domain_contacts_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_domain_contacts_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_domain_contacts_on_item_type_and_item_id ON public.log_domain_contacts USING btree (item_type, item_id); -- --- Name: index_log_domain_contacts_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_domain_contacts_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_domain_contacts_on_whodunnit ON public.log_domain_contacts USING btree (whodunnit); -- --- Name: index_log_domains_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_domains_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_domains_on_item_type_and_item_id ON public.log_domains USING btree (item_type, item_id); -- --- Name: index_log_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_domains_on_whodunnit ON public.log_domains USING btree (whodunnit); -- --- Name: index_log_invoice_items_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_invoice_items_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_invoice_items_on_item_type_and_item_id ON public.log_invoice_items USING btree (item_type, item_id); -- --- Name: index_log_invoice_items_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_invoice_items_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_invoice_items_on_whodunnit ON public.log_invoice_items USING btree (whodunnit); -- --- Name: index_log_invoices_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_invoices_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_invoices_on_item_type_and_item_id ON public.log_invoices USING btree (item_type, item_id); -- --- Name: index_log_invoices_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_invoices_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_invoices_on_whodunnit ON public.log_invoices USING btree (whodunnit); -- --- Name: index_log_nameservers_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_nameservers_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_nameservers_on_item_type_and_item_id ON public.log_nameservers USING btree (item_type, item_id); -- --- Name: index_log_nameservers_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_nameservers_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_nameservers_on_whodunnit ON public.log_nameservers USING btree (whodunnit); -- --- Name: index_log_notifications_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_notifications_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_notifications_on_item_type_and_item_id ON public.log_notifications USING btree (item_type, item_id); -- --- Name: index_log_notifications_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_notifications_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_notifications_on_whodunnit ON public.log_notifications USING btree (whodunnit); -- --- Name: index_log_registrant_verifications_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_registrant_verifications_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_registrant_verifications_on_item_type_and_item_id ON public.log_registrant_verifications USING btree (item_type, item_id); -- --- Name: index_log_registrant_verifications_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_registrant_verifications_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_registrant_verifications_on_whodunnit ON public.log_registrant_verifications USING btree (whodunnit); -- --- Name: index_log_registrars_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_registrars_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_registrars_on_item_type_and_item_id ON public.log_registrars USING btree (item_type, item_id); -- --- Name: index_log_registrars_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_registrars_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_registrars_on_whodunnit ON public.log_registrars USING btree (whodunnit); -- --- Name: index_log_reserved_domains_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_reserved_domains_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_reserved_domains_on_item_type_and_item_id ON public.log_reserved_domains USING btree (item_type, item_id); -- --- Name: index_log_reserved_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_reserved_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_reserved_domains_on_whodunnit ON public.log_reserved_domains USING btree (whodunnit); -- --- Name: index_log_setting_entries_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_setting_entries_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_setting_entries_on_item_type_and_item_id ON public.log_setting_entries USING btree (item_type, item_id); -- --- Name: index_log_setting_entries_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_setting_entries_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_setting_entries_on_whodunnit ON public.log_setting_entries USING btree (whodunnit); -- --- Name: index_log_settings_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_settings_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_settings_on_item_type_and_item_id ON public.log_settings USING btree (item_type, item_id); -- --- Name: index_log_settings_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_settings_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_settings_on_whodunnit ON public.log_settings USING btree (whodunnit); -- --- Name: index_log_users_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_users_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_users_on_item_type_and_item_id ON public.log_users USING btree (item_type, item_id); -- --- Name: index_log_users_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_users_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_users_on_whodunnit ON public.log_users USING btree (whodunnit); -- --- Name: index_nameservers_on_domain_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_nameservers_on_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_nameservers_on_domain_id ON public.nameservers USING btree (domain_id); -- --- Name: index_notifications_on_registrar_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_notifications_on_registrar_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_notifications_on_registrar_id ON public.notifications USING btree (registrar_id); -- --- Name: index_payment_orders_on_invoice_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_payment_orders_on_invoice_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_payment_orders_on_invoice_id ON public.payment_orders USING btree (invoice_id); -- --- Name: index_prices_on_zone_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_prices_on_zone_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_prices_on_zone_id ON public.prices USING btree (zone_id); -- --- Name: index_registrant_verifications_on_created_at; Type: INDEX; Schema: public; Owner: - +-- Name: index_registrant_verifications_on_created_at; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_registrant_verifications_on_created_at ON public.registrant_verifications USING btree (created_at); -- --- Name: index_registrant_verifications_on_domain_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_registrant_verifications_on_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_registrant_verifications_on_domain_id ON public.registrant_verifications USING btree (domain_id); -- --- Name: index_setting_entries_on_code; Type: INDEX; Schema: public; Owner: - +-- Name: index_setting_entries_on_code; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE UNIQUE INDEX index_setting_entries_on_code ON public.setting_entries USING btree (code); -- --- Name: index_settings_on_thing_type_and_thing_id_and_var; Type: INDEX; Schema: public; Owner: - +-- Name: index_settings_on_thing_type_and_thing_id_and_var; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE UNIQUE INDEX index_settings_on_thing_type_and_thing_id_and_var ON public.settings USING btree (thing_type, thing_id, var); -- --- Name: index_users_on_identity_code; Type: INDEX; Schema: public; Owner: - +-- Name: index_users_on_identity_code; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_users_on_identity_code ON public.users USING btree (identity_code); -- --- Name: index_users_on_registrar_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_users_on_registrar_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_users_on_registrar_id ON public.users USING btree (registrar_id); -- --- Name: index_versions_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_versions_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_versions_on_item_type_and_item_id ON public.versions USING btree (item_type, item_id); -- --- Name: index_whois_records_on_domain_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_whois_records_on_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_whois_records_on_domain_id ON public.whois_records USING btree (domain_id); -- --- Name: index_whois_records_on_registrar_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_whois_records_on_registrar_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_whois_records_on_registrar_id ON public.whois_records USING btree (registrar_id); -- --- Name: log_contacts_object_legacy_id; Type: INDEX; Schema: public; Owner: - +-- Name: log_contacts_object_legacy_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX log_contacts_object_legacy_id ON public.log_contacts USING btree ((((object ->> 'legacy_id'::text))::integer)); -- --- Name: log_dnskeys_object_legacy_id; Type: INDEX; Schema: public; Owner: - +-- Name: log_dnskeys_object_legacy_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX log_dnskeys_object_legacy_id ON public.log_contacts USING btree ((((object ->> 'legacy_domain_id'::text))::integer)); -- --- Name: log_domains_object_legacy_id; Type: INDEX; Schema: public; Owner: - +-- Name: log_domains_object_legacy_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX log_domains_object_legacy_id ON public.log_contacts USING btree ((((object ->> 'legacy_id'::text))::integer)); -- --- Name: log_nameservers_object_legacy_id; Type: INDEX; Schema: public; Owner: - +-- Name: log_nameservers_object_legacy_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX log_nameservers_object_legacy_id ON public.log_contacts USING btree ((((object ->> 'legacy_domain_id'::text))::integer)); -- --- Name: unique_data_migrations; Type: INDEX; Schema: public; Owner: - +-- Name: unique_data_migrations; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE UNIQUE INDEX unique_data_migrations ON public.data_migrations USING btree (version); -- --- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: - +-- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE UNIQUE INDEX unique_schema_migrations ON public.schema_migrations USING btree (version); - -- -- Name: contacts contacts_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -4372,7 +4659,7 @@ ALTER TABLE ONLY public.contacts -- --- Name: domain_contacts domain_contacts_contact_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: domain_contacts_contact_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_contacts @@ -4380,7 +4667,7 @@ ALTER TABLE ONLY public.domain_contacts -- --- Name: domain_contacts domain_contacts_domain_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: domain_contacts_domain_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_contacts @@ -4388,7 +4675,7 @@ ALTER TABLE ONLY public.domain_contacts -- --- Name: domains domains_registrant_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: domains_registrant_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domains @@ -4396,7 +4683,7 @@ ALTER TABLE ONLY public.domains -- --- Name: domains domains_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: domains_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domains @@ -4404,7 +4691,7 @@ ALTER TABLE ONLY public.domains -- --- Name: invoices fk_rails_242b91538b; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_242b91538b; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.invoices @@ -4412,7 +4699,7 @@ ALTER TABLE ONLY public.invoices -- --- Name: white_ips fk_rails_36cff3de9c; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_36cff3de9c; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.white_ips @@ -4420,7 +4707,7 @@ ALTER TABLE ONLY public.white_ips -- --- Name: domain_transfers fk_rails_59c422f73d; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_59c422f73d; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_transfers @@ -4428,15 +4715,7 @@ ALTER TABLE ONLY public.domain_transfers -- --- Name: csync_records fk_rails_5df85aeb13; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.csync_records - ADD CONSTRAINT fk_rails_5df85aeb13 FOREIGN KEY (domain_id) REFERENCES public.domains(id); - - --- --- Name: prices fk_rails_78c376257f; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_78c376257f; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.prices @@ -4444,7 +4723,7 @@ ALTER TABLE ONLY public.prices -- --- Name: domain_transfers fk_rails_833ed7f3c0; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_833ed7f3c0; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_transfers @@ -4452,7 +4731,7 @@ ALTER TABLE ONLY public.domain_transfers -- --- Name: account_activities fk_rails_86cd2b09f5; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_86cd2b09f5; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.account_activities @@ -4460,7 +4739,7 @@ ALTER TABLE ONLY public.account_activities -- --- Name: domain_transfers fk_rails_87b8e40c63; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_87b8e40c63; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_transfers @@ -4468,7 +4747,7 @@ ALTER TABLE ONLY public.domain_transfers -- --- Name: actions fk_rails_8c6b5c12eb; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_8c6b5c12eb; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.actions @@ -4476,7 +4755,7 @@ ALTER TABLE ONLY public.actions -- --- Name: notifications fk_rails_8f9734b530; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_8f9734b530; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.notifications @@ -4484,7 +4763,7 @@ ALTER TABLE ONLY public.notifications -- --- Name: actions fk_rails_a5ae3c203d; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_a5ae3c203d; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.actions @@ -4492,7 +4771,7 @@ ALTER TABLE ONLY public.actions -- --- Name: epp_sessions fk_rails_adff2dc8e3; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_adff2dc8e3; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.epp_sessions @@ -4500,7 +4779,7 @@ ALTER TABLE ONLY public.epp_sessions -- --- Name: account_activities fk_rails_b80dbb973d; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_b80dbb973d; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.account_activities @@ -4508,7 +4787,7 @@ ALTER TABLE ONLY public.account_activities -- --- Name: accounts fk_rails_c9f635c0b3; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_c9f635c0b3; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.accounts @@ -4516,7 +4795,7 @@ ALTER TABLE ONLY public.accounts -- --- Name: account_activities fk_rails_ce38d749f6; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_ce38d749f6; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.account_activities @@ -4524,7 +4803,7 @@ ALTER TABLE ONLY public.account_activities -- --- Name: account_activities fk_rails_d2cc3c2fa9; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_d2cc3c2fa9; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.account_activities @@ -4532,7 +4811,7 @@ ALTER TABLE ONLY public.account_activities -- --- Name: registrant_verifications fk_rails_f41617a0e9; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_f41617a0e9; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.registrant_verifications @@ -4540,7 +4819,7 @@ ALTER TABLE ONLY public.registrant_verifications -- --- Name: payment_orders fk_rails_f9dc5857c3; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_f9dc5857c3; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.payment_orders @@ -4548,7 +4827,7 @@ ALTER TABLE ONLY public.payment_orders -- --- Name: invoice_items invoice_items_invoice_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: invoice_items_invoice_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.invoice_items @@ -4556,7 +4835,7 @@ ALTER TABLE ONLY public.invoice_items -- --- Name: notifications messages_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: messages_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.notifications @@ -4564,7 +4843,7 @@ ALTER TABLE ONLY public.notifications -- --- Name: nameservers nameservers_domain_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: nameservers_domain_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.nameservers @@ -4572,12 +4851,25 @@ ALTER TABLE ONLY public.nameservers -- --- Name: users user_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: user_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.users ADD CONSTRAINT user_registrar_id_fk FOREIGN KEY (registrar_id) REFERENCES public.registrars(id); +-- +-- Name: csync_records csync_records_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.csync_records + ADD CONSTRAINT csync_records_pkey PRIMARY KEY (id); + +-- +-- Name: csync_records fk_rails_5df85aeb13; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.csync_records + ADD CONSTRAINT fk_rails_5df85aeb13 FOREIGN KEY (domain_id) REFERENCES public.domains(id); -- -- PostgreSQL database dump complete @@ -5006,9 +5298,9 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200518104105'), ('20200529115011'), ('20200605100827'), -('20200605125332'), ('20200610090110'), ('20200630081231'), +('20200605125332'), ('20200714115338'), ('20200807110611'), ('20200811074839'), @@ -5019,7 +5311,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200910085157'), ('20200910102028'), ('20200916125326'), +('20200917104213'), ('20210215101019'), +('20200921084356'), ('20210405100631'); - - From b2cfc90f4fdf918ae869b9299c138615e48442d5 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Mon, 5 Apr 2021 18:04:29 +0300 Subject: [PATCH 03/12] added clear json history method, added failed tests for force delete --- .../concerns/domain/registry_lockable.rb | 5 +++++ test/models/domain/force_delete_test.rb | 22 +++++++++++++++++++ test/models/domain/registry_lockable_test.rb | 12 ++++++++++ 3 files changed, 39 insertions(+) diff --git a/app/models/concerns/domain/registry_lockable.rb b/app/models/concerns/domain/registry_lockable.rb index 98bef7931..1ea903bdc 100644 --- a/app/models/concerns/domain/registry_lockable.rb +++ b/app/models/concerns/domain/registry_lockable.rb @@ -41,6 +41,7 @@ module Domain::RegistryLockable delete_domain_statuses_which_not_declared_before domain_status end self.locked_by_registrant_at = nil + clear_locked_domain_statuses_history alert_registrar_lock_changes!(lock: false) save! @@ -68,4 +69,8 @@ module Domain::RegistryLockable def delete_domain_statuses_which_not_declared_before(domain_status) statuses.delete(domain_status) unless locked_domain_statuses_history.include? domain_status end + + def clear_locked_domain_statuses_history + self.locked_domain_statuses_history = nil + end end diff --git a/test/models/domain/force_delete_test.rb b/test/models/domain/force_delete_test.rb index 837ad3adc..ae8a713be 100644 --- a/test/models/domain/force_delete_test.rb +++ b/test/models/domain/force_delete_test.rb @@ -12,6 +12,28 @@ class ForceDeleteTest < ActionMailer::TestCase Truemail.configure.default_validation_type = @old_validation_type end + def test_restore_domain_statuses_after_soft_force_delete + @domain.update(statuses: [DomainStatus::SERVER_RENEW_PROHIBITED]) + @domain.schedule_force_delete(type: :soft) + + assert @domain.force_delete_scheduled? + assert @domain.force_delete_domain_statuses_history.include? DomainStatus::SERVER_RENEW_PROHIBITED + + @domain.cancel_force_delete + assert @domain.statuses.include? DomainStatus::SERVER_RENEW_PROHIBITED + end + + def test_clear_force_delete_domain_statuses_history + @domain.update(statuses: [DomainStatus::SERVER_RENEW_PROHIBITED]) + @domain.schedule_force_delete(type: :soft) + + assert @domain.force_delete_scheduled? + assert @domain.force_delete_domain_statuses_history.include? DomainStatus::SERVER_RENEW_PROHIBITED + @domain.cancel_force_delete + + assert_nil @domain.force_delete_domain_statuses_history + end + def test_schedules_force_delete_fast_track assert_not @domain.force_delete_scheduled? travel_to Time.zone.parse('2010-07-05') diff --git a/test/models/domain/registry_lockable_test.rb b/test/models/domain/registry_lockable_test.rb index ea812cf68..3b61e0436 100644 --- a/test/models/domain/registry_lockable_test.rb +++ b/test/models/domain/registry_lockable_test.rb @@ -38,11 +38,23 @@ class DomainRegistryLockableTest < ActiveSupport::TestCase @domain.apply_registry_lock assert @domain.locked_by_registrant? assert_equal @domain.statuses.sort, Domain::RegistryLockable::LOCK_STATUSES.sort + assert @domain.locked_domain_statuses_history.include? DomainStatus::SERVER_UPDATE_PROHIBITED @domain.remove_registry_lock assert @domain.statuses.include? DomainStatus::SERVER_UPDATE_PROHIBITED end + def test_clear_locked_domain_statuses_history + @domain.update(statuses: [DomainStatus::SERVER_UPDATE_PROHIBITED]) + @domain.apply_registry_lock + + assert @domain.locked_by_registrant? + assert @domain.locked_domain_statuses_history.include? DomainStatus::SERVER_UPDATE_PROHIBITED + @domain.remove_registry_lock + + assert_nil @domain.locked_domain_statuses_history + end + def test_registry_lock_on_lockable_domain refute(@domain.locked_by_registrant?) @domain.apply_registry_lock From fe97d7f35a571fbf140e6e5289114b3e1c4a0e44 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Tue, 6 Apr 2021 11:04:25 +0300 Subject: [PATCH 04/12] implement state store before force delete --- app/models/concerns/domain/force_delete.rb | 9 +++++++++ test/models/domain/force_delete_test.rb | 1 + 2 files changed, 10 insertions(+) diff --git a/app/models/concerns/domain/force_delete.rb b/app/models/concerns/domain/force_delete.rb index bc89022d0..45291cfba 100644 --- a/app/models/concerns/domain/force_delete.rb +++ b/app/models/concerns/domain/force_delete.rb @@ -1,6 +1,10 @@ module Domain::ForceDelete # rubocop:disable Metrics/ModuleLength extend ActiveSupport::Concern + FORCE_DELETE_STATUSES = [DomainStatus::FORCE_DELETE, + DomainStatus::SERVER_RENEW_PROHIBITED, + DomainStatus::SERVER_TRANSFER_PROHIBITED] + included do store_accessor :force_delete_data, :force_delete_type, @@ -46,12 +50,17 @@ module Domain::ForceDelete # rubocop:disable Metrics/ModuleLength end def schedule_force_delete(type: :fast_track, notify_by_email: false, reason: nil, email: nil) + self.force_delete_domain_statuses_history = statuses.map do |status| + status if FORCE_DELETE_STATUSES.include? status + end + Domains::ForceDelete::SetForceDelete.run(domain: self, type: type, reason: reason, notify_by_email: notify_by_email, email: email) end def cancel_force_delete Domains::CancelForceDelete::CancelForceDelete.run(domain: self) + self.force_delete_domain_statuses_history = nil end def outzone_date diff --git a/test/models/domain/force_delete_test.rb b/test/models/domain/force_delete_test.rb index ae8a713be..506ba60a3 100644 --- a/test/models/domain/force_delete_test.rb +++ b/test/models/domain/force_delete_test.rb @@ -17,6 +17,7 @@ class ForceDeleteTest < ActionMailer::TestCase @domain.schedule_force_delete(type: :soft) assert @domain.force_delete_scheduled? + assert @domain.force_delete_domain_statuses_history.include? DomainStatus::SERVER_RENEW_PROHIBITED @domain.cancel_force_delete From 73a0b4091b488a5c087c4b5820d2aff70362ba7f Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Tue, 6 Apr 2021 12:32:33 +0300 Subject: [PATCH 05/12] made data migration --- ..._statuses_before_force_delete_to_json_history.rb | 13 +++++++++++++ db/data_schema.rb | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 db/data/20210406083149_transfer_domain_statuses_before_force_delete_to_json_history.rb diff --git a/db/data/20210406083149_transfer_domain_statuses_before_force_delete_to_json_history.rb b/db/data/20210406083149_transfer_domain_statuses_before_force_delete_to_json_history.rb new file mode 100644 index 000000000..9aacf03a8 --- /dev/null +++ b/db/data/20210406083149_transfer_domain_statuses_before_force_delete_to_json_history.rb @@ -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 diff --git a/db/data_schema.rb b/db/data_schema.rb index 84cdf8411..829a6cb26 100644 --- a/db/data_schema.rb +++ b/db/data_schema.rb @@ -1,2 +1,2 @@ # encoding: UTF-8 -DataMigrate::Data.define(version: 20201007104651) +DataMigrate::Data.define(version: 20210406083149) From da3172169a64c5875fcfb7ec8e146e1caa78d897 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Tue, 6 Apr 2021 12:49:21 +0300 Subject: [PATCH 06/12] formatted refactoring --- .../remove_force_delete_statuses.rb | 10 ++++++---- .../restore_statuses_before_force_delete.rb | 4 +++- .../domains/force_delete/prepare_domain.rb | 1 + app/models/concerns/domain/force_delete.rb | 8 ++------ app/models/concerns/domain/registry_lockable.rb | 8 ++++---- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/app/interactions/domains/cancel_force_delete/remove_force_delete_statuses.rb b/app/interactions/domains/cancel_force_delete/remove_force_delete_statuses.rb index c77820ecf..adb310e51 100644 --- a/app/interactions/domains/cancel_force_delete/remove_force_delete_statuses.rb +++ b/app/interactions/domains/cancel_force_delete/remove_force_delete_statuses.rb @@ -2,10 +2,12 @@ module Domains module CancelForceDelete class RemoveForceDeleteStatuses < Base def execute - domain.statuses.delete(DomainStatus::FORCE_DELETE) - domain.statuses.delete(DomainStatus::SERVER_RENEW_PROHIBITED) - domain.statuses.delete(DomainStatus::SERVER_TRANSFER_PROHIBITED) - domain.statuses.delete(DomainStatus::CLIENT_HOLD) + domain_statuses = [DomainStatus::FORCE_DELETE, + DomainStatus::SERVER_RENEW_PROHIBITED, + DomainStatus::SERVER_TRANSFER_PROHIBITED, + DomainStatus::CLIENT_HOLD] + rejected_statuses = domain.statuses.reject { |a| domain_statuses.include? a } + domain.statuses = rejected_statuses domain.save(validate: false) end end 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 c55c06764..4643a8bea 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 @@ -2,8 +2,10 @@ module Domains module CancelForceDelete class RestoreStatusesBeforeForceDelete < Base def execute - domain.statuses = domain.statuses_before_force_delete + # domain.statuses = domain.statuses_before_force_delete + domain.statuses = domain.force_delete_domain_statuses_history || [] domain.statuses_before_force_delete = nil + domain.force_delete_domain_statuses_history = nil domain.save(validate: false) end end diff --git a/app/interactions/domains/force_delete/prepare_domain.rb b/app/interactions/domains/force_delete/prepare_domain.rb index 74eea21ed..e45f7969c 100644 --- a/app/interactions/domains/force_delete/prepare_domain.rb +++ b/app/interactions/domains/force_delete/prepare_domain.rb @@ -6,6 +6,7 @@ module Domains DomainStatus::SERVER_TRANSFER_PROHIBITED].freeze 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) diff --git a/app/models/concerns/domain/force_delete.rb b/app/models/concerns/domain/force_delete.rb index 45291cfba..b514675c1 100644 --- a/app/models/concerns/domain/force_delete.rb +++ b/app/models/concerns/domain/force_delete.rb @@ -3,7 +3,7 @@ module Domain::ForceDelete # rubocop:disable Metrics/ModuleLength FORCE_DELETE_STATUSES = [DomainStatus::FORCE_DELETE, DomainStatus::SERVER_RENEW_PROHIBITED, - DomainStatus::SERVER_TRANSFER_PROHIBITED] + DomainStatus::SERVER_TRANSFER_PROHIBITED].freeze included do store_accessor :force_delete_data, @@ -50,17 +50,13 @@ module Domain::ForceDelete # rubocop:disable Metrics/ModuleLength end def schedule_force_delete(type: :fast_track, notify_by_email: false, reason: nil, email: nil) - self.force_delete_domain_statuses_history = statuses.map do |status| - status if FORCE_DELETE_STATUSES.include? status - end - Domains::ForceDelete::SetForceDelete.run(domain: self, type: type, reason: reason, notify_by_email: notify_by_email, email: email) end def cancel_force_delete Domains::CancelForceDelete::CancelForceDelete.run(domain: self) - self.force_delete_domain_statuses_history = nil + # self.statuses = force_delete_domain_statuses_history end def outzone_date diff --git a/app/models/concerns/domain/registry_lockable.rb b/app/models/concerns/domain/registry_lockable.rb index 1ea903bdc..d7affb8d1 100644 --- a/app/models/concerns/domain/registry_lockable.rb +++ b/app/models/concerns/domain/registry_lockable.rb @@ -9,7 +9,7 @@ module Domain::RegistryLockable return unless registry_lockable? return if locked_by_registrant? - put_statuses_to_json_history_before_locked + save_statuses_history transaction do self.statuses |= LOCK_STATUSES @@ -38,7 +38,7 @@ module Domain::RegistryLockable transaction do LOCK_STATUSES.each do |domain_status| - delete_domain_statuses_which_not_declared_before domain_status + remove_predetermined_statuses domain_status end self.locked_by_registrant_at = nil clear_locked_domain_statuses_history @@ -60,13 +60,13 @@ module Domain::RegistryLockable private - def put_statuses_to_json_history_before_locked + def save_statuses_history self.locked_domain_statuses_history = statuses.map do |status| status if LOCK_STATUSES.include? status end end - def delete_domain_statuses_which_not_declared_before(domain_status) + def remove_predetermined_statuses(domain_status) statuses.delete(domain_status) unless locked_domain_statuses_history.include? domain_status end From 398551340796b988a79df80752422a02c64efb68 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Wed, 7 Apr 2021 12:37:06 +0300 Subject: [PATCH 07/12] separete responsibility of different pieces of code --- .../domains/registry_lock_domain/base.rb | 9 ++++++ .../set_registry_lock_domain.rb | 31 +++++++++++++++++++ .../concerns/domain/registry_lockable.rb | 15 +++++---- 3 files changed, 49 insertions(+), 6 deletions(-) create mode 100644 app/interactions/domains/registry_lock_domain/base.rb create mode 100644 app/interactions/domains/registry_lock_domain/set_registry_lock_domain.rb diff --git a/app/interactions/domains/registry_lock_domain/base.rb b/app/interactions/domains/registry_lock_domain/base.rb new file mode 100644 index 000000000..0f8897589 --- /dev/null +++ b/app/interactions/domains/registry_lock_domain/base.rb @@ -0,0 +1,9 @@ +module Domain::RegistryLockable + extend ActiveSupport::Concern + class Base < ActiveInteraction::Base + object :domain, + class: Domain, + description: 'Domain to set ForceDelete on' + end + end + \ No newline at end of file diff --git a/app/interactions/domains/registry_lock_domain/set_registry_lock_domain.rb b/app/interactions/domains/registry_lock_domain/set_registry_lock_domain.rb new file mode 100644 index 000000000..2092c0184 --- /dev/null +++ b/app/interactions/domains/registry_lock_domain/set_registry_lock_domain.rb @@ -0,0 +1,31 @@ +module Domain::RegistryLockable + extend ActiveSupport::Concern + + class SetRegistratLock < Base + LOCK_STATUSES = [DomainStatus::SERVER_UPDATE_PROHIBITED, + DomainStatus::SERVER_DELETE_PROHIBITED, + DomainStatus::SERVER_TRANSFER_PROHIBITED].freeze + + def execute + transaction do + self.statuses |= LOCK_STATUSES + self.locked_by_registrant_at = Time.zone.now + alert_registrar_lock_changes!(lock: true) + + save! + end + end + + private + + def alert_registrar_lock_changes!(lock: true) + translation = lock ? 'locked' : 'unlocked' + registrar.notifications.create!( + text: I18n.t("notifications.texts.registrar_#{translation}", + domain_name: name), + attached_obj_id: name, + attached_obj_type: self.class.name + ) + end + end +end \ No newline at end of file diff --git a/app/models/concerns/domain/registry_lockable.rb b/app/models/concerns/domain/registry_lockable.rb index d7affb8d1..cf9e7f383 100644 --- a/app/models/concerns/domain/registry_lockable.rb +++ b/app/models/concerns/domain/registry_lockable.rb @@ -11,13 +11,16 @@ module Domain::RegistryLockable save_statuses_history - transaction do - self.statuses |= LOCK_STATUSES - self.locked_by_registrant_at = Time.zone.now - alert_registrar_lock_changes!(lock: true) + # transaction do + # self.statuses |= LOCK_STATUSES + # self.locked_by_registrant_at = Time.zone.now + # alert_registrar_lock_changes!(lock: true) - save! - end + # save! + # end + # Domains::ForceDelete::SetForceDelete.run(domain: self, type: type, reason: reason, + # notify_by_email: notify_by_email, email: email) + Domain::RegistryLockable::SetRegistratLock.run(domain: self) end def registry_lockable? From dad4790ccc7f3a9c681c5d43c0fa060fcbf51a2d Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Wed, 7 Apr 2021 14:46:40 +0300 Subject: [PATCH 08/12] fix: made admin status store, related to lock feature --- app/controllers/admin/domains_controller.rb | 3 +- .../domains/registry_lock_domain/base.rb | 9 ----- .../set_registry_lock_domain.rb | 31 ---------------- .../concerns/domain/registry_lockable.rb | 35 +++++-------------- app/models/domain.rb | 4 ++- app/models/registrant_user.rb | 6 ++-- test/models/domain/registry_lockable_test.rb | 20 ++++------- test/models/domain_test.rb | 4 +-- 8 files changed, 25 insertions(+), 87 deletions(-) delete mode 100644 app/interactions/domains/registry_lock_domain/base.rb delete mode 100644 app/interactions/domains/registry_lock_domain/set_registry_lock_domain.rb diff --git a/app/controllers/admin/domains_controller.rb b/app/controllers/admin/domains_controller.rb index 3e2d78671..6829d506b 100644 --- a/app/controllers/admin/domains_controller.rb +++ b/app/controllers/admin/domains_controller.rb @@ -53,8 +53,9 @@ module Admin dp = ignore_empty_statuses @domain.is_admin = true @domain.admin_status_update dp[:statuses] - if @domain.update(dp) + @domain.admin_store_statuses_history = @domain.statuses + @domain.save flash[:notice] = I18n.t('domain_updated') redirect_to [:admin, @domain] else diff --git a/app/interactions/domains/registry_lock_domain/base.rb b/app/interactions/domains/registry_lock_domain/base.rb deleted file mode 100644 index 0f8897589..000000000 --- a/app/interactions/domains/registry_lock_domain/base.rb +++ /dev/null @@ -1,9 +0,0 @@ -module Domain::RegistryLockable - extend ActiveSupport::Concern - class Base < ActiveInteraction::Base - object :domain, - class: Domain, - description: 'Domain to set ForceDelete on' - end - end - \ No newline at end of file diff --git a/app/interactions/domains/registry_lock_domain/set_registry_lock_domain.rb b/app/interactions/domains/registry_lock_domain/set_registry_lock_domain.rb deleted file mode 100644 index 2092c0184..000000000 --- a/app/interactions/domains/registry_lock_domain/set_registry_lock_domain.rb +++ /dev/null @@ -1,31 +0,0 @@ -module Domain::RegistryLockable - extend ActiveSupport::Concern - - class SetRegistratLock < Base - LOCK_STATUSES = [DomainStatus::SERVER_UPDATE_PROHIBITED, - DomainStatus::SERVER_DELETE_PROHIBITED, - DomainStatus::SERVER_TRANSFER_PROHIBITED].freeze - - def execute - transaction do - self.statuses |= LOCK_STATUSES - self.locked_by_registrant_at = Time.zone.now - alert_registrar_lock_changes!(lock: true) - - save! - end - end - - private - - def alert_registrar_lock_changes!(lock: true) - translation = lock ? 'locked' : 'unlocked' - registrar.notifications.create!( - text: I18n.t("notifications.texts.registrar_#{translation}", - domain_name: name), - attached_obj_id: name, - attached_obj_type: self.class.name - ) - end - end -end \ No newline at end of file diff --git a/app/models/concerns/domain/registry_lockable.rb b/app/models/concerns/domain/registry_lockable.rb index cf9e7f383..ecca7d737 100644 --- a/app/models/concerns/domain/registry_lockable.rb +++ b/app/models/concerns/domain/registry_lockable.rb @@ -9,18 +9,13 @@ module Domain::RegistryLockable return unless registry_lockable? return if locked_by_registrant? - save_statuses_history + transaction do + self.statuses |= LOCK_STATUSES + self.locked_by_registrant_at = Time.zone.now + alert_registrar_lock_changes!(lock: true) - # transaction do - # self.statuses |= LOCK_STATUSES - # self.locked_by_registrant_at = Time.zone.now - # alert_registrar_lock_changes!(lock: true) - - # save! - # end - # Domains::ForceDelete::SetForceDelete.run(domain: self, type: type, reason: reason, - # notify_by_email: notify_by_email, email: email) - Domain::RegistryLockable::SetRegistratLock.run(domain: self) + save! + end end def registry_lockable? @@ -41,10 +36,10 @@ module Domain::RegistryLockable transaction do LOCK_STATUSES.each do |domain_status| - remove_predetermined_statuses domain_status + statuses.delete([domain_status]) end self.locked_by_registrant_at = nil - clear_locked_domain_statuses_history + self.statuses = admin_store_statuses_history || [] alert_registrar_lock_changes!(lock: false) save! @@ -62,18 +57,4 @@ module Domain::RegistryLockable end private - - def save_statuses_history - self.locked_domain_statuses_history = statuses.map do |status| - status if LOCK_STATUSES.include? status - end - end - - def remove_predetermined_statuses(domain_status) - statuses.delete(domain_status) unless locked_domain_statuses_history.include? domain_status - end - - def clear_locked_domain_statuses_history - self.locked_domain_statuses_history = nil - end end diff --git a/app/models/domain.rb b/app/models/domain.rb index 82c5b3ea2..fcf4d8d58 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -18,7 +18,7 @@ class Domain < ApplicationRecord store_accessor :json_statuses_history, :force_delete_domain_statuses_history, - :locked_domain_statuses_history + :admin_store_statuses_history alias_attribute :on_hold_time, :outzone_at alias_attribute :outzone_time, :outzone_at @@ -558,6 +558,8 @@ class Domain < ApplicationRecord # special handling for admin changing status def admin_status_update(update) # check for deleted status + self.admin_store_statuses_history = statuses + statuses.each do |s| unless update.include? s case s diff --git a/app/models/registrant_user.rb b/app/models/registrant_user.rb index f7e85c5af..c6d80901e 100644 --- a/app/models/registrant_user.rb +++ b/app/models/registrant_user.rb @@ -17,11 +17,11 @@ class RegistrantUser < User Country.new(alpha2_code) end - def companies(company_register = CompanyRegister::Client.new) + def companies(company_register = nil) return [] if ident.include?('-') - company_register.representation_rights(citizen_personal_code: ident, - citizen_country_code: country.alpha3) + [OpenStruct.new(registration_number: '43344412', company_name: 'TestFirma'), + OpenStruct.new(registration_number: '12345678', company_name: 'SuperFirma OU')] end def contacts(representable: true) diff --git a/test/models/domain/registry_lockable_test.rb b/test/models/domain/registry_lockable_test.rb index 3b61e0436..32973a679 100644 --- a/test/models/domain/registry_lockable_test.rb +++ b/test/models/domain/registry_lockable_test.rb @@ -34,25 +34,19 @@ class DomainRegistryLockableTest < ActiveSupport::TestCase end def test_restore_domain_statuses_after_unlock - @domain.update(statuses: [DomainStatus::SERVER_UPDATE_PROHIBITED]) + @domain.statuses = [DomainStatus::SERVER_UPDATE_PROHIBITED] + @domain.admin_store_statuses_history = [DomainStatus::SERVER_UPDATE_PROHIBITED] + @domain.save + assert @domain.admin_store_statuses_history.include? DomainStatus::SERVER_UPDATE_PROHIBITED + @domain.apply_registry_lock assert @domain.locked_by_registrant? assert_equal @domain.statuses.sort, Domain::RegistryLockable::LOCK_STATUSES.sort - assert @domain.locked_domain_statuses_history.include? DomainStatus::SERVER_UPDATE_PROHIBITED @domain.remove_registry_lock assert @domain.statuses.include? DomainStatus::SERVER_UPDATE_PROHIBITED - end - - def test_clear_locked_domain_statuses_history - @domain.update(statuses: [DomainStatus::SERVER_UPDATE_PROHIBITED]) - @domain.apply_registry_lock - - assert @domain.locked_by_registrant? - assert @domain.locked_domain_statuses_history.include? DomainStatus::SERVER_UPDATE_PROHIBITED - @domain.remove_registry_lock - - assert_nil @domain.locked_domain_statuses_history + assert_not @domain.statuses.include? DomainStatus::SERVER_TRANSFER_PROHIBITED + assert_not @domain.statuses.include? DomainStatus::SERVER_DELETE_PROHIBITED end def test_registry_lock_on_lockable_domain diff --git a/test/models/domain_test.rb b/test/models/domain_test.rb index 8740fe853..2fdb916ad 100644 --- a/test/models/domain_test.rb +++ b/test/models/domain_test.rb @@ -29,12 +29,12 @@ class DomainTest < ActiveSupport::TestCase def test_valid_domain_statuses_history @domain.force_delete_domain_statuses_history = [DomainStatus::SERVER_UPDATE_PROHIBITED, DomainStatus::SERVER_TRANSFER_PROHIBITED] - @domain.locked_domain_statuses_history = [DomainStatus::SERVER_UPDATE_PROHIBITED] + @domain.admin_store_statuses_history = [DomainStatus::SERVER_UPDATE_PROHIBITED] assert @domain.valid? assert @domain.json_statuses_history['force_delete_domain_statuses_history'].include? 'serverUpdateProhibited' assert @domain.json_statuses_history['force_delete_domain_statuses_history'].include? 'serverTransferProhibited' - assert_equal @domain.json_statuses_history['locked_domain_statuses_history'], ['serverUpdateProhibited'] + assert_equal @domain.json_statuses_history['admin_store_statuses_history'], ['serverUpdateProhibited'] end # https://www.internet.ee/domeenid/ee-domeenireeglid#domeeninimede-registreerimine From 9c0018d6feeb7872490fedbdb3782a8bc19253d2 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Wed, 7 Apr 2021 15:38:14 +0300 Subject: [PATCH 09/12] refactoring --- app/controllers/admin/domains_controller.rb | 4 ++-- app/models/concerns/domain/registry_lockable.rb | 2 -- app/models/domain.rb | 2 +- app/models/registrant_user.rb | 6 +++--- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/controllers/admin/domains_controller.rb b/app/controllers/admin/domains_controller.rb index 6829d506b..9b64aa72c 100644 --- a/app/controllers/admin/domains_controller.rb +++ b/app/controllers/admin/domains_controller.rb @@ -54,8 +54,8 @@ module Admin @domain.is_admin = true @domain.admin_status_update dp[:statuses] if @domain.update(dp) - @domain.admin_store_statuses_history = @domain.statuses - @domain.save + # @domain.admin_store_statuses_history = @domain.statuses + # @domain.save flash[:notice] = I18n.t('domain_updated') redirect_to [:admin, @domain] else diff --git a/app/models/concerns/domain/registry_lockable.rb b/app/models/concerns/domain/registry_lockable.rb index ecca7d737..4f9340aaf 100644 --- a/app/models/concerns/domain/registry_lockable.rb +++ b/app/models/concerns/domain/registry_lockable.rb @@ -55,6 +55,4 @@ module Domain::RegistryLockable attached_obj_type: self.class.name ) end - - private end diff --git a/app/models/domain.rb b/app/models/domain.rb index fcf4d8d58..43001deef 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -558,8 +558,8 @@ class Domain < ApplicationRecord # special handling for admin changing status def admin_status_update(update) # check for deleted status - self.admin_store_statuses_history = statuses + update(admin_store_statuses_history: update) statuses.each do |s| unless update.include? s case s diff --git a/app/models/registrant_user.rb b/app/models/registrant_user.rb index c6d80901e..f7e85c5af 100644 --- a/app/models/registrant_user.rb +++ b/app/models/registrant_user.rb @@ -17,11 +17,11 @@ class RegistrantUser < User Country.new(alpha2_code) end - def companies(company_register = nil) + def companies(company_register = CompanyRegister::Client.new) return [] if ident.include?('-') - [OpenStruct.new(registration_number: '43344412', company_name: 'TestFirma'), - OpenStruct.new(registration_number: '12345678', company_name: 'SuperFirma OU')] + company_register.representation_rights(citizen_personal_code: ident, + citizen_country_code: country.alpha3) end def contacts(representable: true) From 3f8a99d8ca3c6aa054f8ac82a964a2361826b88f Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Wed, 7 Apr 2021 20:10:10 +0300 Subject: [PATCH 10/12] fixed storing lockable statuses --- app/controllers/admin/domains_controller.rb | 3 +-- app/models/concerns/domain/registry_lockable.rb | 1 + app/models/domain.rb | 10 +++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/domains_controller.rb b/app/controllers/admin/domains_controller.rb index 9b64aa72c..17d1d5e1a 100644 --- a/app/controllers/admin/domains_controller.rb +++ b/app/controllers/admin/domains_controller.rb @@ -53,9 +53,8 @@ module Admin dp = ignore_empty_statuses @domain.is_admin = true @domain.admin_status_update dp[:statuses] + if @domain.update(dp) - # @domain.admin_store_statuses_history = @domain.statuses - # @domain.save flash[:notice] = I18n.t('domain_updated') redirect_to [:admin, @domain] else diff --git a/app/models/concerns/domain/registry_lockable.rb b/app/models/concerns/domain/registry_lockable.rb index 4f9340aaf..6d8a478fa 100644 --- a/app/models/concerns/domain/registry_lockable.rb +++ b/app/models/concerns/domain/registry_lockable.rb @@ -40,6 +40,7 @@ module Domain::RegistryLockable end self.locked_by_registrant_at = nil self.statuses = admin_store_statuses_history || [] + admin_store_statuses_history = nil alert_registrar_lock_changes!(lock: false) save! diff --git a/app/models/domain.rb b/app/models/domain.rb index 43001deef..73240c8b4 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -557,9 +557,17 @@ class Domain < ApplicationRecord # special handling for admin changing status def admin_status_update(update) + lock_statuses = [DomainStatus::SERVER_UPDATE_PROHIBITED, + DomainStatus::SERVER_DELETE_PROHIBITED, + DomainStatus::SERVER_TRANSFER_PROHIBITED] # check for deleted status + update(admin_store_statuses_history: update) unless locked_by_registrant? - update(admin_store_statuses_history: update) + if locked_by_registrant? + result = update.reject { |status| lock_statuses.include? status } + update(admin_store_statuses_history: result) + + end statuses.each do |s| unless update.include? s case s From 1cc6f2576fae44abf0cb62e70db1c207b7b92610 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Thu, 8 Apr 2021 11:10:14 +0300 Subject: [PATCH 11/12] added tests --- app/controllers/admin/domains_controller.rb | 2 +- .../concerns/domain/registry_lockable.rb | 1 - app/models/domain.rb | 11 +++--- ...domain_statuses_to_admin_status_history.rb | 13 +++++++ db/data_schema.rb | 2 +- test/models/domain/registry_lockable_test.rb | 35 ++++++++++++++++++- 6 files changed, 55 insertions(+), 9 deletions(-) create mode 100644 db/data/20210407140317_transfer_data_from_domain_statuses_to_admin_status_history.rb diff --git a/app/controllers/admin/domains_controller.rb b/app/controllers/admin/domains_controller.rb index 17d1d5e1a..3e2d78671 100644 --- a/app/controllers/admin/domains_controller.rb +++ b/app/controllers/admin/domains_controller.rb @@ -53,7 +53,7 @@ module Admin dp = ignore_empty_statuses @domain.is_admin = true @domain.admin_status_update dp[:statuses] - + if @domain.update(dp) flash[:notice] = I18n.t('domain_updated') redirect_to [:admin, @domain] diff --git a/app/models/concerns/domain/registry_lockable.rb b/app/models/concerns/domain/registry_lockable.rb index 6d8a478fa..4f9340aaf 100644 --- a/app/models/concerns/domain/registry_lockable.rb +++ b/app/models/concerns/domain/registry_lockable.rb @@ -40,7 +40,6 @@ module Domain::RegistryLockable end self.locked_by_registrant_at = nil self.statuses = admin_store_statuses_history || [] - admin_store_statuses_history = nil alert_registrar_lock_changes!(lock: false) save! diff --git a/app/models/domain.rb b/app/models/domain.rb index 73240c8b4..e1e977761 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -12,6 +12,10 @@ class Domain < ApplicationRecord include Domain::Disputable include Domain::BulkUpdatable + LOCK_STATUSES = [DomainStatus::SERVER_UPDATE_PROHIBITED, + DomainStatus::SERVER_DELETE_PROHIBITED, + DomainStatus::SERVER_TRANSFER_PROHIBITED].freeze + attr_accessor :roles attr_accessor :legal_document_id @@ -557,17 +561,14 @@ class Domain < ApplicationRecord # special handling for admin changing status def admin_status_update(update) - lock_statuses = [DomainStatus::SERVER_UPDATE_PROHIBITED, - DomainStatus::SERVER_DELETE_PROHIBITED, - DomainStatus::SERVER_TRANSFER_PROHIBITED] # check for deleted status update(admin_store_statuses_history: update) unless locked_by_registrant? if locked_by_registrant? - result = update.reject { |status| lock_statuses.include? status } + result = update.reject { |status| LOCK_STATUSES.include? status } update(admin_store_statuses_history: result) - end + statuses.each do |s| unless update.include? s case s diff --git a/db/data/20210407140317_transfer_data_from_domain_statuses_to_admin_status_history.rb b/db/data/20210407140317_transfer_data_from_domain_statuses_to_admin_status_history.rb new file mode 100644 index 000000000..f1c390a61 --- /dev/null +++ b/db/data/20210407140317_transfer_data_from_domain_statuses_to_admin_status_history.rb @@ -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 diff --git a/db/data_schema.rb b/db/data_schema.rb index 829a6cb26..15f126bd9 100644 --- a/db/data_schema.rb +++ b/db/data_schema.rb @@ -1,2 +1,2 @@ # encoding: UTF-8 -DataMigrate::Data.define(version: 20210406083149) +DataMigrate::Data.define(version: 20210407140317) diff --git a/test/models/domain/registry_lockable_test.rb b/test/models/domain/registry_lockable_test.rb index 32973a679..82770d0eb 100644 --- a/test/models/domain/registry_lockable_test.rb +++ b/test/models/domain/registry_lockable_test.rb @@ -3,7 +3,6 @@ require 'test_helper' class DomainRegistryLockableTest < ActiveSupport::TestCase def setup super - @domain = domains(:airport) end @@ -33,6 +32,24 @@ class DomainRegistryLockableTest < ActiveSupport::TestCase assert_not(@domain.locked_by_registrant?) end + def test_remove_lockalable_statuses_after_admin_intervention + @domain.apply_registry_lock + assert @domain.locked_by_registrant? + assert_equal @domain.statuses.sort, Domain::RegistryLockable::LOCK_STATUSES.sort + + deleted_status = @domain.statuses - [DomainStatus::SERVER_DELETE_PROHIBITED] + @domain.update(statuses: deleted_status) + assert_not @domain.locked_by_registrant? + + @domain.apply_registry_lock + assert @domain.locked_by_registrant? + @domain.remove_registry_lock + + assert_not @domain.statuses.include? DomainStatus::SERVER_UPDATE_PROHIBITED + assert_not @domain.statuses.include? DomainStatus::SERVER_TRANSFER_PROHIBITED + assert_not @domain.statuses.include? DomainStatus::SERVER_DELETE_PROHIBITED + end + def test_restore_domain_statuses_after_unlock @domain.statuses = [DomainStatus::SERVER_UPDATE_PROHIBITED] @domain.admin_store_statuses_history = [DomainStatus::SERVER_UPDATE_PROHIBITED] @@ -49,6 +66,22 @@ class DomainRegistryLockableTest < ActiveSupport::TestCase assert_not @domain.statuses.include? DomainStatus::SERVER_DELETE_PROHIBITED end + def test_add_additinal_status_for_locked_domain + @domain.apply_registry_lock + assert @domain.locked_by_registrant? + assert_equal @domain.statuses.sort, Domain::RegistryLockable::LOCK_STATUSES.sort + + @domain.statuses += [DomainStatus::SERVER_RENEW_PROHIBITED] + @domain.admin_store_statuses_history = [DomainStatus::SERVER_RENEW_PROHIBITED] + @domain.save + + @domain.remove_registry_lock + assert @domain.statuses.include? DomainStatus::SERVER_RENEW_PROHIBITED + assert_not @domain.statuses.include? DomainStatus::SERVER_UPDATE_PROHIBITED + assert_not @domain.statuses.include? DomainStatus::SERVER_TRANSFER_PROHIBITED + assert_not @domain.statuses.include? DomainStatus::SERVER_DELETE_PROHIBITED + end + def test_registry_lock_on_lockable_domain refute(@domain.locked_by_registrant?) @domain.apply_registry_lock From 441a1911c48bc3d39fd3201a52b8b96484a46be3 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Thu, 8 Apr 2021 11:15:24 +0300 Subject: [PATCH 12/12] refactoring --- app/models/domain.rb | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/app/models/domain.rb b/app/models/domain.rb index e1e977761..0348e8b34 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -559,16 +559,24 @@ class Domain < ApplicationRecord statuses.include?(DomainStatus::FORCE_DELETE) end + def update_unless_locked_by_registrant(update) + update(admin_store_statuses_history: update) unless locked_by_registrant? + end + + def update_not_by_locked_statuses(update) + return unless locked_by_registrant? + + result = update.reject { |status| LOCK_STATUSES.include? status } + update(admin_store_statuses_history: result) + end + # special handling for admin changing status def admin_status_update(update) - # check for deleted status - update(admin_store_statuses_history: update) unless locked_by_registrant? + update_unless_locked_by_registrant(update) - if locked_by_registrant? - result = update.reject { |status| LOCK_STATUSES.include? status } - update(admin_store_statuses_history: result) - end - + update_not_by_locked_statuses(update) + + # check for deleted status statuses.each do |s| unless update.include? s case s