diff --git a/db/migrate/20250204094550_add_admin_contacts_rules_to_settings.rb b/db/migrate/20250204094550_add_admin_contacts_rules_to_settings.rb new file mode 100644 index 000000000..d585ca26f --- /dev/null +++ b/db/migrate/20250204094550_add_admin_contacts_rules_to_settings.rb @@ -0,0 +1,48 @@ +class AddAdminContactsRulesToSettings < ActiveRecord::Migration[6.1] + def up + unless SettingEntry.exists?(code: 'admin_contacts_required_for_org') + SettingEntry.create!( + code: 'admin_contacts_required_for_org', + value: 'true', + format: 'boolean', + group: 'domain_validation' + ) + else + puts "SettingEntry admin_contacts_required_for_org already exists" + end + + unless SettingEntry.exists?(code: 'admin_contacts_required_for_minors') + SettingEntry.create!( + code: 'admin_contacts_required_for_minors', + value: 'true', + format: 'boolean', + group: 'domain_validation' + ) + else + puts "SettingEntry admin_contacts_required_for_minors already exists" + end + + unless SettingEntry.exists?(code: 'admin_contacts_allowed_ident_type') + SettingEntry.create!( + code: 'admin_contacts_allowed_ident_type', + value: { + 'birthday' => true, + 'priv' => true, + 'org' => false + }.to_json, + format: 'array', + group: 'domain_validation' + ) + else + puts "SettingEntry admin_contacts_allowed_ident_type already exists" + end + end + + def down + SettingEntry.where(code: [ + 'admin_contacts_required_for_org', + 'admin_contacts_required_for_minors', + 'admin_contacts_allowed_ident_type' + ]).destroy_all + end +end diff --git a/db/structure.sql b/db/structure.sql index 9653f454e..b0e725a9e 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -1168,6 +1168,38 @@ CREATE SEQUENCE public.epp_sessions_id_seq ALTER SEQUENCE public.epp_sessions_id_seq OWNED BY public.epp_sessions.id; +-- +-- Name: free_domain_reservation_holders; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.free_domain_reservation_holders ( + id bigint NOT NULL, + user_unique_id character varying NOT NULL, + domain_names character varying[] DEFAULT '{}'::character varying[], + created_at timestamp(6) without time zone NOT NULL, + updated_at timestamp(6) without time zone NOT NULL +); + + +-- +-- Name: free_domain_reservation_holders_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.free_domain_reservation_holders_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: free_domain_reservation_holders_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.free_domain_reservation_holders_id_seq OWNED BY public.free_domain_reservation_holders.id; + + -- -- Name: invoice_items; Type: TABLE; Schema: public; Owner: - -- @@ -2675,7 +2707,8 @@ CREATE TABLE public.reserved_domains ( updator_str character varying, legacy_id integer, name character varying NOT NULL, - password character varying NOT NULL + password character varying NOT NULL, + expire_at timestamp without time zone ); @@ -3185,6 +3218,13 @@ ALTER TABLE ONLY public.epp_logs ALTER COLUMN id SET DEFAULT nextval('public.epp ALTER TABLE ONLY public.epp_sessions ALTER COLUMN id SET DEFAULT nextval('public.epp_sessions_id_seq'::regclass); +-- +-- Name: free_domain_reservation_holders id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.free_domain_reservation_holders ALTER COLUMN id SET DEFAULT nextval('public.free_domain_reservation_holders_id_seq'::regclass); + + -- -- Name: invoice_items id; Type: DEFAULT; Schema: public; Owner: - -- @@ -3714,6 +3754,14 @@ ALTER TABLE ONLY public.epp_sessions ADD CONSTRAINT epp_sessions_pkey PRIMARY KEY (id); +-- +-- Name: free_domain_reservation_holders free_domain_reservation_holders_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.free_domain_reservation_holders + ADD CONSTRAINT free_domain_reservation_holders_pkey PRIMARY KEY (id); + + -- -- Name: invoice_items invoice_items_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -5667,6 +5715,9 @@ INSERT INTO "schema_migrations" (version) VALUES ('20241030095636'), ('20241104104620'), ('20241112093540'), -('20241112124405'); +('20241112124405'), +('20241129095711'), +('20241206085817'), +('20250204094550');