Merge remote-tracking branch 'origin/master' into refactor-contact-archivation

This commit is contained in:
Karl Erik Õunapuu 2020-09-16 10:24:55 +03:00
commit ab1fa9064e
No known key found for this signature in database
GPG key ID: C9DD647298A34764
47 changed files with 453 additions and 290 deletions

View file

@ -0,0 +1,11 @@
class FixTypoInSettingName < ActiveRecord::Migration[6.0]
def up
setting = Setting.find_by(code: 'request_confrimation_on_registrant_change_enabled')
setting.update(code: 'request_confirmation_on_registrant_change_enabled')
end
def down
setting = Setting.find_by(code: 'request_confirmation_on_registrant_change_enabled')
setting.update(code: 'request_confrimation_on_registrant_change_enabled')
end
end

View file

@ -0,0 +1,5 @@
class RemoveDomainsRegisteredAt < ActiveRecord::Migration[5.0]
def change
remove_column :domains, :registered_at
end
end

View file

@ -0,0 +1,9 @@
class RemoveImportFilePathFromBankStatements < ActiveRecord::Migration[6.0]
def up
remove_column :bank_statements, :import_file_path
end
def down
add_column :bank_statements, :import_file_path, :string
end
end

View file

@ -0,0 +1,5 @@
class ChangeInvoiceItemPriceScaleToThreePlaces < ActiveRecord::Migration[6.0]
def change
change_column :invoice_items, :price, :decimal, precision: 10, scale: 3
end
end

View file

@ -0,0 +1,26 @@
class CreateVersionForPrices < ActiveRecord::Migration[6.0]
def up
create_table :log_prices, force: :cascade do |t|
t.string :item_type, null: false
t.integer :item_id, null: false
t.string :event, null: false
t.string :whodunnit
t.json :object
t.json :object_changes
t.datetime :created_at
t.string :session
t.json :children
t.string :uuid
end
add_index 'log_prices', ['item_type', 'item_id'], name: 'index_log_prices_on_item_type_and_item_id', using: :btree
add_index 'log_prices', ['whodunnit'], name: 'index_log_prices_on_whodunnit', using: :btree
end
def down
remove_index :log_prices, name: 'index_log_prices_on_item_type_and_item_id'
remove_index :log_prices, name: 'index_log_prices_on_whodunnit'
drop_table :log_prices
end
end

View file

@ -26,7 +26,7 @@ ActiveRecord::Base.transaction do
SettingEntry.create(code: 'client_side_status_editing_enabled', value: 'false', format: 'boolean', group: 'other')
SettingEntry.create(code: 'api_ip_whitelist_enabled', value: 'false', format: 'boolean', group: 'other')
SettingEntry.create(code: 'registrar_ip_whitelist_enabled', value: 'false', format: 'boolean', group: 'other')
SettingEntry.create(code: 'request_confrimation_on_registrant_change_enabled', value: 'true', format: 'boolean', group: 'other')
SettingEntry.create(code: 'request_confirmation_on_registrant_change_enabled', value: 'true', format: 'boolean', group: 'other')
SettingEntry.create(code: 'request_confirmation_on_domain_deletion_enabled', value: 'true', format: 'boolean', group: 'other')
SettingEntry.create(code: 'default_language', value: 'en', format: 'string', group: 'other')
SettingEntry.create(code: 'invoice_number_min', value: '131050', format: 'integer', group: 'billing')

View file

@ -371,7 +371,6 @@ CREATE TABLE public.bank_statements (
id integer NOT NULL,
bank_code character varying,
iban character varying,
import_file_path character varying,
queried_at timestamp without time zone,
created_at timestamp without time zone,
updated_at timestamp without time zone,
@ -778,7 +777,6 @@ CREATE TABLE public.domains (
id integer NOT NULL,
name character varying NOT NULL,
registrar_id integer NOT NULL,
registered_at timestamp without time zone,
valid_to timestamp without time zone NOT NULL,
registrant_id integer NOT NULL,
transfer_code character varying NOT NULL,
@ -964,7 +962,7 @@ CREATE TABLE public.invoice_items (
description character varying NOT NULL,
unit character varying NOT NULL,
quantity integer NOT NULL,
price numeric(10,2) NOT NULL,
price numeric(10,3) NOT NULL,
created_at timestamp without time zone,
updated_at timestamp without time zone,
creator_str character varying,
@ -1708,7 +1706,45 @@ ALTER SEQUENCE public.log_payment_orders_id_seq OWNED BY public.log_payment_orde
--
-- Name: log_registrant_verifications; Type: TABLE; Schema: public; Owner: -; Tablespace:
-- Name: log_prices; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.log_prices (
id bigint NOT NULL,
item_type character varying NOT NULL,
item_id integer NOT NULL,
event character varying NOT NULL,
whodunnit character varying,
object json,
object_changes json,
created_at timestamp without time zone,
session character varying,
children json,
uuid character varying
);
--
-- Name: log_prices_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.log_prices_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: log_prices_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.log_prices_id_seq OWNED BY public.log_prices.id;
--
-- Name: log_registrant_verifications; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.log_registrant_verifications (
@ -2094,8 +2130,8 @@ CREATE TABLE public.prices (
price_cents integer NOT NULL,
valid_from timestamp without time zone,
valid_to timestamp without time zone,
creator_str character varying,
updator_str character varying,
creator_str character varying,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
duration interval,
@ -2840,7 +2876,14 @@ ALTER TABLE ONLY public.log_payment_orders ALTER COLUMN id SET DEFAULT nextval('
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
-- 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: -
--
ALTER TABLE ONLY public.log_registrant_verifications ALTER COLUMN id SET DEFAULT nextval('public.log_registrant_verifications_id_seq'::regclass);
@ -3306,7 +3349,15 @@ ALTER TABLE ONLY public.log_payment_orders
--
-- Name: log_registrant_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
-- 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
@ -4828,6 +4879,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20191203083643'),
('20191206183853'),
('20191212133136'),
('20191217013225'),
('20191219112434'),
('20191219124429'),
('20191227110904'),
@ -4851,5 +4903,8 @@ INSERT INTO "schema_migrations" (version) VALUES
('20200811074839'),
('20200812090409'),
('20200812125810'),
('20200902131603');
('20200902131603'),
('20200908131554'),
('20200910085157'),
('20200910102028');