1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pgadmin_ynh.git synced 2024-09-03 19:56:38 +02:00

Fix issue with removed table collum

This commit is contained in:
Josué Tille 2023-02-17 21:58:04 +01:00
parent fe4323a21d
commit 4183f1a7e4
No known key found for this signature in database
GPG key ID: 716A6C99B04194EF

View file

@ -23,17 +23,17 @@ crypted_password = crypto.encrypt(password, user_encrypted_password)
# Declare database data to put in database
data = {'id': 1,'user_id': 1, 'servergroup_id' : 1, 'name': 'Yunohost Server', 'host': 'localhost', 'port': 5432,'maintenance_db':'postgres','username':username,
'ssl_mode':'prefer', 'comment' : '', 'password' :crypted_password,'role':'', 'discovery_id':'', 'hostaddr':'','db_res':'','passfile':'',
'comment' : '', 'password' :crypted_password,'role':'', 'discovery_id':'', 'hostaddr':'','db_res':'','passfile':'',
'sslcert' :'','sslkey':'','sslrootcert':'','sslcrl':''}
# Insert new data in database
cursor = conn.cursor()
cursor.execute('''INSERT INTO `server`(
`id`,`user_id`,`servergroup_id`,`name`,`host`,`port`,`maintenance_db`,`username`,
`ssl_mode`,`comment`,`password`,`role`,`discovery_id`,`hostaddr`,`db_res`,`passfile`,`sslcert`,`sslkey`,`sslrootcert`,`sslcrl`
`comment`,`password`,`role`,`discovery_id`,`hostaddr`,`db_res`,`passfile`,`sslcert`,`sslkey`,`sslrootcert`,`sslcrl`
) VALUES(
:id,:user_id,:servergroup_id,:name,:host,:port,:maintenance_db,:username,
:ssl_mode,:comment,:password,:role,:discovery_id,:hostaddr,:db_res,:passfile,:sslcert,:sslkey,:sslrootcert,:sslcrl
:comment,:password,:role,:discovery_id,:hostaddr,:db_res,:passfile,:sslcert,:sslkey,:sslrootcert,:sslcrl
)''', data)
conn.commit()