Mercurial Hosting > luan
comparison src/luan/host/init.luan @ 1394:8fe777ba5045
change postgres password
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 08 Sep 2019 22:13:08 -0600 |
parents | cc0dbca576dc |
children | 1979cff9aad2 |
comparison
equal
deleted
inserted
replaced
1393:cc0dbca576dc | 1394:8fe777ba5045 |
---|---|
87 user = domain | 87 user = domain |
88 password = Io.password | 88 password = Io.password |
89 } | 89 } |
90 local db = database(pg) | 90 local db = database(pg) |
91 local exists = db.query("select datname from pg_database where datname=?",domain)() ~= nil; | 91 local exists = db.query("select datname from pg_database where datname=?",domain)() ~= nil; |
92 logger.info("exists "..exists) | 92 --logger.info("exists "..exists) |
93 if not exists then | 93 if not exists then |
94 db.update( [[create user "]]..spec.user..[[" with encrypted password ']]..spec.password..[[']] ) | 94 db.update( [[create user "]]..spec.user..[[" with encrypted password ']]..spec.password..[[']] ) |
95 db.update( [[create database "]]..domain..[[" owner "]]..spec.user..[["]] ) | 95 db.update( [[create database "]]..domain..[[" owner "]]..spec.user..[["]] ) |
96 end | 96 end |
97 db.close() | 97 db.close() |