Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #271: Split DB schema for onboarding #324

Merged
merged 2 commits into from
Aug 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions docs/sql/mysql/enrollment/create-schema.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* PowerAuth Enrollment Server
* Copyright (C) 2022 Wultra s.r.o.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

CREATE TABLE es_operation_template (
id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT,
placeholder VARCHAR(255) NOT NULL,
language VARCHAR(8) NOT NULL,
title VARCHAR(255) NOT NULL,
message TEXT NOT NULL,
attributes TEXT
) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

CREATE UNIQUE INDEX es_operation_template_placeholder ON es_operation_template(placeholder, language);
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* PowerAuth Enrollment Server
* Copyright (C) 2020 Wultra s.r.o.
* Copyright (C) 2022 Wultra s.r.o.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
Expand All @@ -16,17 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

CREATE TABLE es_operation_template (
id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT,
placeholder VARCHAR(255) NOT NULL,
language VARCHAR(8) NOT NULL,
title VARCHAR(255) NOT NULL,
message TEXT NOT NULL,
attributes TEXT
) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

CREATE UNIQUE INDEX es_operation_template_placeholder ON es_operation_template(placeholder, language);

CREATE TABLE es_onboarding_process (
id VARCHAR(36) NOT NULL PRIMARY KEY,
identification_data VARCHAR(1024) NOT NULL,
Expand Down
30 changes: 30 additions & 0 deletions docs/sql/oracle/enrollment/create-schema.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* PowerAuth Enrollment Server
* Copyright (C) 2020 Wultra s.r.o.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

CREATE SEQUENCE ES_OPERATION_TEMPLATE_SEQ MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20;

CREATE TABLE ES_OPERATION_TEMPLATE (
ID NUMBER(19) NOT NULL PRIMARY KEY,
PLACEHOLDER VARCHAR2(255 CHAR) NOT NULL,
LANGUAGE VARCHAR2(8 CHAR) NOT NULL,
TITLE VARCHAR2(255 CHAR) NOT NULL,
MESSAGE BLOB NOT NULL,
ATTRIBUTES BLOB
);

CREATE UNIQUE INDEX ES_OPERATION_TEMPLATE_PLACEHOLDER ON ES_OPERATION_TEMPLATE(PLACEHOLDER, LANGUAGE);
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* PowerAuth Enrollment Server
* Copyright (C) 2020 Wultra s.r.o.
* Copyright (C) 2022 Wultra s.r.o.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
Expand All @@ -17,18 +17,6 @@
*/

CREATE SEQUENCE ES_DOCUMENT_RESULT_SEQ MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 10 START WITH 1 CACHE 20;
CREATE SEQUENCE ES_OPERATION_TEMPLATE_SEQ MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20;

CREATE TABLE ES_OPERATION_TEMPLATE (
ID NUMBER(19) NOT NULL PRIMARY KEY,
PLACEHOLDER VARCHAR2(255 CHAR) NOT NULL,
LANGUAGE VARCHAR2(8 CHAR) NOT NULL,
TITLE VARCHAR2(255 CHAR) NOT NULL,
MESSAGE BLOB NOT NULL,
ATTRIBUTES BLOB
);

CREATE UNIQUE INDEX ES_OPERATION_TEMPLATE_PLACEHOLDER ON ES_OPERATION_TEMPLATE(PLACEHOLDER, LANGUAGE);

CREATE TABLE ES_ONBOARDING_PROCESS (
ID VARCHAR2(36 CHAR) NOT NULL PRIMARY KEY,
Expand Down
173 changes: 0 additions & 173 deletions docs/sql/postgresql/create-schema.sql

This file was deleted.

32 changes: 32 additions & 0 deletions docs/sql/postgresql/enrollment/create-schema.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* PowerAuth Enrollment Server
* Copyright (C) 2020 Wultra s.r.o.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

--
-- Create sequences. Maximum value for PostgreSQL is 9223372036854775807.
--- See: https://www.postgresql.org/docs/9.6/sql-createsequence.html
--
CREATE SEQUENCE "es_operation_template_seq" MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT BY 1 START WITH 1 CACHE 20;

CREATE TABLE es_operation_template (
id BIGINT NOT NULL PRIMARY KEY,
placeholder VARCHAR(255) NOT NULL,
language VARCHAR(8) NOT NULL,
title VARCHAR(255) NOT NULL,
message TEXT NOT NULL,
attributes TEXT
);
35 changes: 35 additions & 0 deletions docs/sql/postgresql/onboarding/create-schema.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* PowerAuth Enrollment Server
* Copyright (C) 2022 Wultra s.r.o.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

--
-- Create sequences. Maximum value for PostgreSQL is 9223372036854775807.
--- See: https://www.postgresql.org/docs/9.6/sql-createsequence.html
--
CREATE SEQUENCE "es_document_result_seq" MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT BY 10 START WITH 1 CACHE 20;
CREATE SEQUENCE "es_operation_template_seq" MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT BY 1 START WITH 1 CACHE 20;

CREATE TABLE es_operation_template (
id BIGINT NOT NULL PRIMARY KEY,
placeholder VARCHAR(255) NOT NULL,
language VARCHAR(8) NOT NULL,
title VARCHAR(255) NOT NULL,
message TEXT NOT NULL,
attributes TEXT
);

CREATE UNIQUE INDEX es_operation_template_placeholder ON es_operation_template(placeholder, language);
banterCZ marked this conversation as resolved.
Show resolved Hide resolved