From 83c4e7503bf79ce571f6d18c9be193e64870ad4f Mon Sep 17 00:00:00 2001 From: Lubos Racansky Date: Wed, 2 Aug 2023 12:56:50 +0200 Subject: [PATCH] Fix #819: Document enrollment database structure --- docs/Database-Structure.md | 42 ++++++++++++++++++++++++++++++++++++++ docs/Home.md | 1 + docs/_Sidebar.md | 1 + 3 files changed, 44 insertions(+) create mode 100644 docs/Database-Structure.md diff --git a/docs/Database-Structure.md b/docs/Database-Structure.md new file mode 100644 index 000000000..f40378595 --- /dev/null +++ b/docs/Database-Structure.md @@ -0,0 +1,42 @@ +# Database Structure + + + +You can download DDL scripts for supported databases: + +- [PostgreSQL - Create Database Schema](./sql/postgresql/enrollment/create-schema.sql) +- [Oracle - Create Database Schema](./sql/oracle/enrollment/create-schema.sql) + + +## Auditing + +The DDL files contain an `audit_log` table definition. The table differs slightly per database. + +Only one `audit_log` table is required per PowerAuth stack in case the same schema is used for all deployed applications. + +For more information about auditing library, see the [Wultra auditing library documentation](https://github.com/wultra/lime-java-core#wultra-auditing-library). + + +## Table Documentation + +This chapter explains individual tables and their columns. The column types are used from PostgreSQL dialect, other databases use types that are equivalent (mapping is usually straight-forward). + + +### Operation Template Table + +Stores operation templates to be shown by the mobile application. +For more information, see [Operation Extensions](Operation-Extensions.md) and [Customizing Operation Form Data](Operation-Form-Data.md). + +#### Schema + +| Name | Type | Info | Note | +|---------------|----------------|------------------------|------------------------------------------------------------------------------------------| +| `id` | `BIGINT` | `NOT NULL PRIMARY KEY` | Autogenerated record identifier. | +| `placeholder` | `VARCHAR(255)` | `NOT NULL` | Operation type at PowerAuth server. | +| `language` | `VARCHAR(8)` | `NOT NULL` | Language of the template. | +| `title` | `VARCHAR(255)` | `NOT NULL` | Title of the operation. | +| `message` | `TEXT` | `NOT NULL` | Message for the user related to the operation. | +| `attributes` | `TEXT` | | Structured custom form data attributes as JSON. | +| `ui` | `TEXT` | | JSON configuration which may affect behavior or visual aspect of the mobile application. | + + diff --git a/docs/Home.md b/docs/Home.md index c16d9bebc..0b6058869 100644 --- a/docs/Home.md +++ b/docs/Home.md @@ -6,6 +6,7 @@ PowerAuth Enrollment Server is an easy to deploy backend service used for bootst - [Deploying Enrollment Server](./Deploying-Enrollment-Server.md) - [Deploying Enrollment Server on JBoss/Wildfly](./Deploying-Wildfly.md) +- [Database Structure](./Database-Structure.md) - [Migration Instructions](./Migration-Instructions.md) - [Configuration Properties](./Configuration-Properties.md) - [Documentation for Onboarding Server](./onboarding/Home.md) diff --git a/docs/_Sidebar.md b/docs/_Sidebar.md index f1cb671e4..4a7235108 100644 --- a/docs/_Sidebar.md +++ b/docs/_Sidebar.md @@ -2,6 +2,7 @@ - [Deploying Enrollment Server](./Deploying-Enrollment-Server.md) - [Deploying Enrollment Server on JBoss/Wildfly](./Deploying-Wildfly.md) +- [Database Structure](./Database-Structure.md) - [Migration Instructions](./Migration-Instructions.md) - [Configuration Properties](./Configuration-Properties.md) - [Documentation for Onboarding Server](./onboarding/Home.md)