From f919930d23fc4d1064506fb877ce70efa9b2db59 Mon Sep 17 00:00:00 2001 From: Mustafa Baser Date: Thu, 8 Dec 2022 19:17:41 +0300 Subject: [PATCH] fix: jans-linux-setup longtext for pgsql --- .../jans_setup/setup_app/utils/db_utils.py | 2 +- .../static/rdbm/sql_data_types.json | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/jans-linux-setup/jans_setup/setup_app/utils/db_utils.py b/jans-linux-setup/jans_setup/setup_app/utils/db_utils.py index ee819f01b2a..a6d8fd97d64 100644 --- a/jans-linux-setup/jans_setup/setup_app/utils/db_utils.py +++ b/jans-linux-setup/jans_setup/setup_app/utils/db_utils.py @@ -721,7 +721,7 @@ def rdm_automapper(self, force=False): if Config.rdbm_type == 'mysql': for tbl in self.Base.classes: for col in tbl.__table__.columns: - if isinstance(col.type, sqlalchemy.dialects.mysql.LONGTEXT) and col.comment.lower() == 'json': + if isinstance(col.type, sqlalchemy.dialects.mysql.LONGTEXT) and col.comment and col.comment.lower() == 'json': col.type = sqlalchemy.dialects.mysql.json.JSON() base.logIt("Reflected tables {}".format(list(self.metadata.tables.keys()))) diff --git a/jans-linux-setup/jans_setup/static/rdbm/sql_data_types.json b/jans-linux-setup/jans_setup/static/rdbm/sql_data_types.json index 065a3523803..12bd29f4c08 100644 --- a/jans-linux-setup/jans_setup/static/rdbm/sql_data_types.json +++ b/jans-linux-setup/jans_setup/static/rdbm/sql_data_types.json @@ -832,6 +832,9 @@ "mysql": { "type": "TEXT" }, + "pgsql": { + "type": "TEXT" + }, "spanner": { "type": "STRING(MAX)" } @@ -840,6 +843,9 @@ "mysql": { "type": "TEXT" }, + "pgsql": { + "type": "TEXT" + }, "spanner": { "type": "STRING(MAX)" } @@ -848,6 +854,9 @@ "mysql": { "type": "TEXT" }, + "pgsql": { + "type": "TEXT" + }, "spanner": { "type": "STRING(MAX)" } @@ -857,6 +866,10 @@ "size": 128, "type": "VARCHAR" }, + "pgsql": { + "size": 128, + "type": "VARCHAR" + }, "spanner": { "size": 128, "type": "STRING" @@ -866,6 +879,9 @@ "mysql": { "type": "LONGTEXT" }, + "pgsql": { + "type": "TEXT" + }, "spanner": { "type": "STRING(MAX)" } @@ -875,6 +891,10 @@ "size": 2048, "type": "VARCHAR" }, + "pgsql": { + "size": 2048, + "type": "VARCHAR" + }, "spanner": { "size": 2048, "type": "STRING"