Skip to content

Commit

Permalink
Merge pull request #820 from /issues/819-database-structure
Browse files Browse the repository at this point in the history
Fix #819: Document enrollment database structure
  • Loading branch information
banterCZ authored Aug 24, 2023
2 parents 1718b07 + 83c4e75 commit 252558a
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
42 changes: 42 additions & 0 deletions docs/Database-Structure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Database Structure

<!-- TEMPLATE database -->

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).

<!-- begin database table es_operation_template -->
### 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. |

<!-- end -->
1 change: 1 addition & 0 deletions docs/Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions docs/_Sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 252558a

Please sign in to comment.