Skip to content

Commit

Permalink
fix: jans-linux-setup longtext for pgsql (#3266)
Browse files Browse the repository at this point in the history
  • Loading branch information
devrimyatar authored Dec 8, 2022
1 parent 8546356 commit 547cee8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion jans-linux-setup/jans_setup/setup_app/utils/db_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())))
Expand Down
20 changes: 20 additions & 0 deletions jans-linux-setup/jans_setup/static/rdbm/sql_data_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,9 @@
"mysql": {
"type": "TEXT"
},
"pgsql": {
"type": "TEXT"
},
"spanner": {
"type": "STRING(MAX)"
}
Expand All @@ -840,6 +843,9 @@
"mysql": {
"type": "TEXT"
},
"pgsql": {
"type": "TEXT"
},
"spanner": {
"type": "STRING(MAX)"
}
Expand All @@ -848,6 +854,9 @@
"mysql": {
"type": "TEXT"
},
"pgsql": {
"type": "TEXT"
},
"spanner": {
"type": "STRING(MAX)"
}
Expand All @@ -857,6 +866,10 @@
"size": 128,
"type": "VARCHAR"
},
"pgsql": {
"size": 128,
"type": "VARCHAR"
},
"spanner": {
"size": 128,
"type": "STRING"
Expand All @@ -866,6 +879,9 @@
"mysql": {
"type": "LONGTEXT"
},
"pgsql": {
"type": "TEXT"
},
"spanner": {
"type": "STRING(MAX)"
}
Expand All @@ -875,6 +891,10 @@
"size": 2048,
"type": "VARCHAR"
},
"pgsql": {
"size": 2048,
"type": "VARCHAR"
},
"spanner": {
"size": 2048,
"type": "STRING"
Expand Down

0 comments on commit 547cee8

Please sign in to comment.