mirror of
https://github.com/internetee/registry.git
synced 2025-06-06 20:55:44 +02:00
Add audit for Settings
This commit is contained in:
parent
37ae30b637
commit
c977872c44
4 changed files with 100 additions and 1 deletions
|
@ -0,0 +1,26 @@
|
|||
class CreateVersionsForSettingEntries < ActiveRecord::Migration[6.0]
|
||||
def up
|
||||
create_table :log_setting_entries, 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_setting_entries', ['item_type', 'item_id'], name: 'index_log_setting_entries_on_item_type_and_item_id', using: :btree
|
||||
add_index 'log_setting_entries', ['whodunnit'], name: 'index_log_setting_entries_on_whodunnit', using: :btree
|
||||
end
|
||||
|
||||
def down
|
||||
remove_index :log_setting_entries, name: 'index_log_setting_entries_on_item_type_and_item_id'
|
||||
remove_index :log_setting_entries, name: 'index_log_setting_entries_on_whodunnit'
|
||||
|
||||
drop_table :log_setting_entries
|
||||
end
|
||||
end
|
|
@ -1820,6 +1820,44 @@ CREATE SEQUENCE public.log_reserved_domains_id_seq
|
|||
ALTER SEQUENCE public.log_reserved_domains_id_seq OWNED BY public.log_reserved_domains.id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: log_setting_entries; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
||||
--
|
||||
|
||||
CREATE TABLE public.log_setting_entries (
|
||||
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_setting_entries_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE SEQUENCE public.log_setting_entries_id_seq
|
||||
START WITH 1
|
||||
INCREMENT BY 1
|
||||
NO MINVALUE
|
||||
NO MAXVALUE
|
||||
CACHE 1;
|
||||
|
||||
|
||||
--
|
||||
-- Name: log_setting_entries_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER SEQUENCE public.log_setting_entries_id_seq OWNED BY public.log_setting_entries.id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: log_settings; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
||||
--
|
||||
|
@ -2822,6 +2860,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: 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: -
|
||||
--
|
||||
|
@ -3284,6 +3329,14 @@ ALTER TABLE ONLY public.log_reserved_domains
|
|||
ADD CONSTRAINT log_reserved_domains_pkey PRIMARY KEY (id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: log_setting_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public.log_setting_entries
|
||||
ADD CONSTRAINT log_setting_entries_pkey PRIMARY KEY (id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: log_settings_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
||||
--
|
||||
|
@ -3982,6 +4035,20 @@ CREATE INDEX index_log_reserved_domains_on_item_type_and_item_id ON public.log_r
|
|||
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:
|
||||
--
|
||||
|
||||
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:
|
||||
--
|
||||
|
||||
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:
|
||||
--
|
||||
|
@ -4780,6 +4847,7 @@ INSERT INTO "schema_migrations" (version) VALUES
|
|||
('20200714115338'),
|
||||
('20200807110611'),
|
||||
('20200811074839'),
|
||||
('20200812090409');
|
||||
('20200812090409'),
|
||||
('20200812125810');
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue