insertintopotential(name,icon,description)values('Recycler Unit','/icons/NGSUIItemPotentialAbility.png','Test description for Recycler Unit. Provides {mel_dmg}% melee dmg');
insertintopotential(name,icon,description)values('Indomitable Unit','/icons/NGSUIItemPotentialAbility.png','Test description for Indomitable Unit. Provides {mel_dmg}% melee dmg');
insertintopotential(name,icon,description)values('Defensive Formation','/icons/NGSUIItemPotentialAbility.png','Test description for Defensive Formation. Provides {mel_dmg}% melee dmg');
insertintopotential(name,icon,description)values('Offensive Formation','/icons/NGSUIItemPotentialAbility.png','Test description for Offensive Formation. Provides {mel_dmg}% melee dmg');
insertintopotential(name,icon,description)values('Bastion Unit','/icons/NGSUIItemPotentialAbility.png','Test description for Bastion Unit. Provides {mel_dmg}% melee dmg');
insertintopotential(name,icon,description)values('Meditation Unit','/icons/NGSUIItemPotentialAbility.png','Test description for Meditation Unit. Provides {mel_dmg}% melee dmg');
insertintopotential(name,icon,description)values('Mustered Might Unit','/icons/NGSUIItemPotentialAbility.png','Test description for Mustered Might Unit. Provides {mel_dmg}% melee dmg');
insertintopotential(name,icon,description)values('Dynamo Unit','/icons/NGSUIItemPotentialAbility.png','Test description for Dynamo Unit. Provides {mel_dmg}% melee dmg');
insertintopotential(name,icon,description)values('Berserk Unit','/icons/NGSUIItemPotentialAbility.png','Test description for Berserk Unit. Provides {mel_dmg}% melee dmg');
insertintopotential(name,icon,description)values('Wellspring Unit','/icons/NGSUIItemPotentialAbility.png','Test description for Wellspring Unit. Provides {mel_dmg}% melee dmg');
insertintopotential(name,icon,description)values('Endurance Unit','/icons/NGSUIItemPotentialAbility.png','Test description for Endurance Unit. Provides {mel_dmg}% melee dmg');
db3.query('select pg_terminate_backend (pid) from pg_stat_activity where pg_stat_activity.datname=\'ngsplanner\' or pg_stat_activity.datname=\'ngsplanner2\'')
.then(()=>{
returndb3.query('drop database ngsplanner')
returndb3.query('drop database ngsplanner')
})
.then(()=>{
returndb3.query('create database ngsplanner with template '+req.body.database)
returndb3.query('create database ngsplanner with template ngsplanner2')
db3.query('select pg_terminate_backend (pid) from pg_stat_activity where pg_stat_activity.datname=\'ngsplanner\' or pg_stat_activity.datname=\'ngsplanner2\'')
.then(()=>{
returndb3.query('drop database ngsplanner')
})
.then(()=>{
returndb3.query('create database ngsplanner with template ngsplanner2')
db3.query('select pg_terminate_backend (pid) from pg_stat_activity where pg_stat_activity.datname=\'ngsplanner\' or pg_stat_activity.datname=\'ngsplanner2\'')
.then(()=>{
returndb3.query('drop database ngsplanner2')
})
db2=newPool({
user:'postgres',
password:'',
host:'postgres',
database:'ngsplanner2',
port:5432,
.then(()=>{
returndb3.query('create database ngsplanner2 with template ngsplanner')
db3.query('select pg_terminate_backend (pid) from pg_stat_activity where pg_stat_activity.datname=\'ngsplanner\' or pg_stat_activity.datname=\'ngsplanner2\'')
.then(()=>{
returndb3.query('drop database ngsplanner2')
})
.then(()=>{
returndb3.query('create database ngsplanner2 with template ngsplanner')
})
.then(()=>{
db=newPool({
user:'postgres',
password:'',
host:'postgres',
database:'ngsplanner',
port:5432,
.then(()=>{
db=newPool({
user:'postgres',
password:'',
host:'postgres',
database:'ngsplanner',
port:5432,
})
db2=newPool({
user:'postgres',
password:'',
host:'postgres',
database:'ngsplanner2',
port:5432,
})
res.status(200).send("Done!")
})
db2=newPool({
user:'postgres',
password:'',
host:'postgres',
database:'ngsplanner2',
port:5432,
.catch((err)=>{
res.status(500).send(err.message)
})
res.status(200).send("Done!")
})
.catch((err)=>{
res.status(500).send(err.message)
})
})
app.post(PREFIX+"/databases/backup",(req,res)=>{
db.end(()=>{})
vardate=newDate()
db3.query('select pg_terminate_backend (pid) from pg_stat_activity where pg_stat_activity.datname=\'ngsplanner\'')
.then(()=>{
returndb3.query('create database ngsplanner'+String(date.getFullYear()).padStart(4,'0')+String(date.getMonth()).padStart(2,'0')+String(date.getDate()).padStart(2,'0')+String(date.getHours()).padStart(2,'0')+String(date.getMinutes()).padStart(2,'0')+String(date.getSeconds()).padStart(2,'0')+' with template ngsplanner')