diff --git a/ordinis-migrations/src/main/resources/db/changelog/changes/0010-envers-tables.xml b/ordinis-migrations/src/main/resources/db/changelog/changes/0010-envers-tables.xml new file mode 100644 index 0000000..2b06ef6 --- /dev/null +++ b/ordinis-migrations/src/main/resources/db/changelog/changes/0010-envers-tables.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Зеркало dictionary_records + (rev, revtype) для Envers audit. + + CREATE TABLE dictionary_records_aud ( + id UUID NOT NULL, + rev INTEGER NOT NULL REFERENCES revinfo(rev), + revtype SMALLINT, + dictionary_id UUID, + business_key VARCHAR(256), + data JSONB, + geometry GEOMETRY(Geometry, 4326), + data_scope VARCHAR(32), + valid_from TIMESTAMPTZ, + valid_to TIMESTAMPTZ, + created_at TIMESTAMPTZ, + updated_at TIMESTAMPTZ, + created_by VARCHAR(128), + updated_by VARCHAR(128), + version BIGINT, + PRIMARY KEY (id, rev) + ); + CREATE INDEX idx_dict_records_aud_rev ON dictionary_records_aud(rev); + CREATE INDEX idx_dict_records_aud_id ON dictionary_records_aud(id); + + + + diff --git a/ordinis-migrations/src/main/resources/db/changelog/master.xml b/ordinis-migrations/src/main/resources/db/changelog/master.xml index 2e11263..c20282f 100644 --- a/ordinis-migrations/src/main/resources/db/changelog/master.xml +++ b/ordinis-migrations/src/main/resources/db/changelog/master.xml @@ -14,5 +14,6 @@ +