fix: can't compare str with int

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
Akhil Narang 2024-03-13 12:52:54 +05:30
parent 61e54eac17
commit 06db7a2b2b
No known key found for this signature in database
GPG key ID: 9DCC61E211BF645F

View file

@ -21,7 +21,7 @@ def setup_database():
root_conn.sql(f'GRANT ALL PRIVILEGES ON DATABASE "{frappe.conf.db_name}" TO "{frappe.conf.db_user}"')
if psql_version := root_conn.sql("SHOW server_version_num", as_dict=True):
semver_version_num = psql_version[0].get("server_version_num") or "140000"
if semver_version_num > 150000:
if cint(semver_version_num) > 150000:
root_conn.sql(f'ALTER DATABASE "{frappe.conf.db_name}" OWNER TO "{frappe.conf.db_user}"')
root_conn.close()