Add new patch updates
This commit is contained in:
parent
e481597008
commit
ed68984f55
5
ngsplanner_patch.sql
Normal file
5
ngsplanner_patch.sql
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
/*9 Aug Database Patch*/
|
||||||
|
alter table potential add column description text;
|
||||||
|
alter table weapon_existence_data add column icon text;
|
||||||
|
alter table weapon_type add column shorthand text;
|
||||||
|
alter table weapon_existence_data add column special_name text;
|
@ -77,6 +77,7 @@ CREATE TABLE "weapon" (
|
|||||||
CREATE TABLE "weapon_type" (
|
CREATE TABLE "weapon_type" (
|
||||||
"id" SERIAL UNIQUE PRIMARY KEY,
|
"id" SERIAL UNIQUE PRIMARY KEY,
|
||||||
"name" text,
|
"name" text,
|
||||||
|
"shorthand" text,
|
||||||
"icon" text,
|
"icon" text,
|
||||||
"dmg_type" int
|
"dmg_type" int
|
||||||
);
|
);
|
||||||
@ -84,7 +85,8 @@ CREATE TABLE "weapon_type" (
|
|||||||
CREATE TABLE "potential" (
|
CREATE TABLE "potential" (
|
||||||
"id" SERIAL UNIQUE PRIMARY KEY,
|
"id" SERIAL UNIQUE PRIMARY KEY,
|
||||||
"name" text,
|
"name" text,
|
||||||
"icon" text
|
"icon" text,
|
||||||
|
"description" text
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE "potential_data" (
|
CREATE TABLE "potential_data" (
|
||||||
@ -239,7 +241,9 @@ CREATE TABLE "weapon_existence_data" (
|
|||||||
"weapon_type_id" int,
|
"weapon_type_id" int,
|
||||||
"weapon_id" int,
|
"weapon_id" int,
|
||||||
"popularity" int,
|
"popularity" int,
|
||||||
"editors_choice" int
|
"editors_choice" int,
|
||||||
|
"icon" text,
|
||||||
|
"special_name" text
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE "augment_type" (
|
CREATE TABLE "augment_type" (
|
||||||
|
@ -53,17 +53,17 @@ insert into weapon_type(name,icon,dmg_type) values('Rod','/icons/NGSUIItemRodMin
|
|||||||
insert into weapon_type(name,icon,dmg_type) values('Talis','/icons/NGSUIItemTalisMini.png',2);
|
insert into weapon_type(name,icon,dmg_type) values('Talis','/icons/NGSUIItemTalisMini.png',2);
|
||||||
insert into weapon_type(name,icon,dmg_type) values('Wand','/icons/NGSUIItemWandMini.png',2);
|
insert into weapon_type(name,icon,dmg_type) values('Wand','/icons/NGSUIItemWandMini.png',2);
|
||||||
|
|
||||||
insert into potential(name,icon) values('Recycler Unit','/icons/NGSUIItemPotentialAbility.png');
|
insert into potential(name,icon,description) values('Recycler Unit','/icons/NGSUIItemPotentialAbility.png','Test description for Recycler Unit. Provides {mel_dmg}% melee dmg');
|
||||||
insert into potential(name,icon) values('Indomitable Unit','/icons/NGSUIItemPotentialAbility.png');
|
insert into potential(name,icon,description) values('Indomitable Unit','/icons/NGSUIItemPotentialAbility.png','Test description for Indomitable Unit. Provides {mel_dmg}% melee dmg');
|
||||||
insert into potential(name,icon) values('Defensive Formation','/icons/NGSUIItemPotentialAbility.png');
|
insert into potential(name,icon,description) values('Defensive Formation','/icons/NGSUIItemPotentialAbility.png','Test description for Defensive Formation. Provides {mel_dmg}% melee dmg');
|
||||||
insert into potential(name,icon) values('Offensive Formation','/icons/NGSUIItemPotentialAbility.png');
|
insert into potential(name,icon,description) values('Offensive Formation','/icons/NGSUIItemPotentialAbility.png','Test description for Offensive Formation. Provides {mel_dmg}% melee dmg');
|
||||||
insert into potential(name,icon) values('Bastion Unit','/icons/NGSUIItemPotentialAbility.png');
|
insert into potential(name,icon,description) values('Bastion Unit','/icons/NGSUIItemPotentialAbility.png','Test description for Bastion Unit. Provides {mel_dmg}% melee dmg');
|
||||||
insert into potential(name,icon) values('Meditation Unit','/icons/NGSUIItemPotentialAbility.png');
|
insert into potential(name,icon,description) values('Meditation Unit','/icons/NGSUIItemPotentialAbility.png','Test description for Meditation Unit. Provides {mel_dmg}% melee dmg');
|
||||||
insert into potential(name,icon) values('Mustered Might Unit','/icons/NGSUIItemPotentialAbility.png');
|
insert into potential(name,icon,description) values('Mustered Might Unit','/icons/NGSUIItemPotentialAbility.png','Test description for Mustered Might Unit. Provides {mel_dmg}% melee dmg');
|
||||||
insert into potential(name,icon) values('Dynamo Unit','/icons/NGSUIItemPotentialAbility.png');
|
insert into potential(name,icon,description) values('Dynamo Unit','/icons/NGSUIItemPotentialAbility.png','Test description for Dynamo Unit. Provides {mel_dmg}% melee dmg');
|
||||||
insert into potential(name,icon) values('Berserk Unit','/icons/NGSUIItemPotentialAbility.png');
|
insert into potential(name,icon,description) values('Berserk Unit','/icons/NGSUIItemPotentialAbility.png','Test description for Berserk Unit. Provides {mel_dmg}% melee dmg');
|
||||||
insert into potential(name,icon) values('Wellspring Unit','/icons/NGSUIItemPotentialAbility.png');
|
insert into potential(name,icon,description) values('Wellspring Unit','/icons/NGSUIItemPotentialAbility.png','Test description for Wellspring Unit. Provides {mel_dmg}% melee dmg');
|
||||||
insert into potential(name,icon) values('Endurance Unit','/icons/NGSUIItemPotentialAbility.png');
|
insert into potential(name,icon,description) values('Endurance Unit','/icons/NGSUIItemPotentialAbility.png','Test description for Endurance Unit. Provides {mel_dmg}% melee dmg');
|
||||||
|
|
||||||
insert into class_level_data(class_id,name,level,hp,atk,def)
|
insert into class_level_data(class_id,name,level,hp,atk,def)
|
||||||
values((SELECT id from class WHERE name='Hunter' limit 1),'Hunter Lv.1',1,300,450,304);
|
values((SELECT id from class WHERE name='Hunter' limit 1),'Hunter Lv.1',1,300,450,304);
|
||||||
@ -101,54 +101,54 @@ insert into potential_data(potential_id,name,level,mel_dmg,rng_dmg,tec_dmg,crit_
|
|||||||
insert into potential_data(potential_id,name,level,mel_dmg,rng_dmg,tec_dmg,crit_rate,crit_dmg,pp_cost_reduction,active_pp_recovery,natural_pp_recovery,dmg_res,all_down_res,burn_res,freeze_res,blind_res,shock_res,panic_res,poison_res,battle_power_value,pb_gauge_build)
|
insert into potential_data(potential_id,name,level,mel_dmg,rng_dmg,tec_dmg,crit_rate,crit_dmg,pp_cost_reduction,active_pp_recovery,natural_pp_recovery,dmg_res,all_down_res,burn_res,freeze_res,blind_res,shock_res,panic_res,poison_res,battle_power_value,pb_gauge_build)
|
||||||
values((select id from potential where name='Indomitable Unit' limit 1),'Indomitable Unit Lv.1',1,1.18,1.18,1.18,0,0,0,0,0,0,1.10,0,0,0,0,0,0,10,0);
|
values((select id from potential where name='Indomitable Unit' limit 1),'Indomitable Unit Lv.1',1,1.18,1.18,1.18,0,0,0,0,0,0,1.10,0,0,0,0,0,0,10,0);
|
||||||
|
|
||||||
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
|
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice,icon)
|
||||||
values((select id from weapon_type where name='Sword' limit 1),(select id from weapon where name='Primm' limit 1),0,0);
|
values((select id from weapon_type where name='Sword' limit 1),(select id from weapon where name='Primm' limit 1),0,0,'');
|
||||||
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
|
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice,icon)
|
||||||
values((select id from weapon_type where name='Spear' limit 1),(select id from weapon where name='Primm' limit 1),0,0);
|
values((select id from weapon_type where name='Spear' limit 1),(select id from weapon where name='Primm' limit 1),0,0,'');
|
||||||
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
|
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice,icon)
|
||||||
values((select id from weapon_type where name='Wired Lance' limit 1),(select id from weapon where name='Primm' limit 1),0,0);
|
values((select id from weapon_type where name='Wired Lance' limit 1),(select id from weapon where name='Primm' limit 1),0,0,'');
|
||||||
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
|
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice,icon)
|
||||||
values((select id from weapon_type where name='Twin Dagger' limit 1),(select id from weapon where name='Primm' limit 1),0,0);
|
values((select id from weapon_type where name='Twin Dagger' limit 1),(select id from weapon where name='Primm' limit 1),0,0,'');
|
||||||
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
|
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice,icon)
|
||||||
values((select id from weapon_type where name='Double Saber' limit 1),(select id from weapon where name='Primm' limit 1),0,0);
|
values((select id from weapon_type where name='Double Saber' limit 1),(select id from weapon where name='Primm' limit 1),0,0,'');
|
||||||
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
|
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice,icon)
|
||||||
values((select id from weapon_type where name='Knuckles' limit 1),(select id from weapon where name='Primm' limit 1),0,0);
|
values((select id from weapon_type where name='Knuckles' limit 1),(select id from weapon where name='Primm' limit 1),0,0,'');
|
||||||
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
|
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice,icon)
|
||||||
values((select id from weapon_type where name='Assault Rifle' limit 1),(select id from weapon where name='Primm' limit 1),0,0);
|
values((select id from weapon_type where name='Assault Rifle' limit 1),(select id from weapon where name='Primm' limit 1),0,0,'');
|
||||||
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
|
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice,icon)
|
||||||
values((select id from weapon_type where name='Launcher' limit 1),(select id from weapon where name='Primm' limit 1),0,0);
|
values((select id from weapon_type where name='Launcher' limit 1),(select id from weapon where name='Primm' limit 1),0,0,'');
|
||||||
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
|
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice,icon)
|
||||||
values((select id from weapon_type where name='Twin Machine Guns' limit 1),(select id from weapon where name='Primm' limit 1),0,0);
|
values((select id from weapon_type where name='Twin Machine Guns' limit 1),(select id from weapon where name='Primm' limit 1),0,0,'');
|
||||||
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
|
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice,icon)
|
||||||
values((select id from weapon_type where name='Rod' limit 1),(select id from weapon where name='Primm' limit 1),0,0);
|
values((select id from weapon_type where name='Rod' limit 1),(select id from weapon where name='Primm' limit 1),0,0,'');
|
||||||
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
|
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice,icon)
|
||||||
values((select id from weapon_type where name='Talis' limit 1),(select id from weapon where name='Primm' limit 1),0,0);
|
values((select id from weapon_type where name='Talis' limit 1),(select id from weapon where name='Primm' limit 1),0,0,'');
|
||||||
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
|
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice,icon)
|
||||||
values((select id from weapon_type where name='Wand' limit 1),(select id from weapon where name='Primm' limit 1),0,0);
|
values((select id from weapon_type where name='Wand' limit 1),(select id from weapon where name='Primm' limit 1),0,0,'');
|
||||||
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
|
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice,icon)
|
||||||
values((select id from weapon_type where name='Sword' limit 1),(select id from weapon where name='Tzvia' limit 1),0,0);
|
values((select id from weapon_type where name='Sword' limit 1),(select id from weapon where name='Tzvia' limit 1),0,0,'');
|
||||||
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
|
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice,icon)
|
||||||
values((select id from weapon_type where name='Spear' limit 1),(select id from weapon where name='Tzvia' limit 1),0,0);
|
values((select id from weapon_type where name='Spear' limit 1),(select id from weapon where name='Tzvia' limit 1),0,0,'');
|
||||||
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
|
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice,icon)
|
||||||
values((select id from weapon_type where name='Wired Lance' limit 1),(select id from weapon where name='Tzvia' limit 1),0,0);
|
values((select id from weapon_type where name='Wired Lance' limit 1),(select id from weapon where name='Tzvia' limit 1),0,0,'');
|
||||||
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
|
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice,icon)
|
||||||
values((select id from weapon_type where name='Twin Dagger' limit 1),(select id from weapon where name='Tzvia' limit 1),0,0);
|
values((select id from weapon_type where name='Twin Dagger' limit 1),(select id from weapon where name='Tzvia' limit 1),0,0,'');
|
||||||
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
|
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice,icon)
|
||||||
values((select id from weapon_type where name='Double Saber' limit 1),(select id from weapon where name='Tzvia' limit 1),0,0);
|
values((select id from weapon_type where name='Double Saber' limit 1),(select id from weapon where name='Tzvia' limit 1),0,0,'');
|
||||||
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
|
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice,icon)
|
||||||
values((select id from weapon_type where name='Knuckles' limit 1),(select id from weapon where name='Tzvia' limit 1),0,0);
|
values((select id from weapon_type where name='Knuckles' limit 1),(select id from weapon where name='Tzvia' limit 1),0,0,'');
|
||||||
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
|
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice,icon)
|
||||||
values((select id from weapon_type where name='Assault Rifle' limit 1),(select id from weapon where name='Tzvia' limit 1),0,0);
|
values((select id from weapon_type where name='Assault Rifle' limit 1),(select id from weapon where name='Tzvia' limit 1),0,0,'');
|
||||||
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
|
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice,icon)
|
||||||
values((select id from weapon_type where name='Launcher' limit 1),(select id from weapon where name='Tzvia' limit 1),0,0);
|
values((select id from weapon_type where name='Launcher' limit 1),(select id from weapon where name='Tzvia' limit 1),0,0,'');
|
||||||
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
|
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice,icon)
|
||||||
values((select id from weapon_type where name='Twin Machine Guns' limit 1),(select id from weapon where name='Tzvia' limit 1),0,0);
|
values((select id from weapon_type where name='Twin Machine Guns' limit 1),(select id from weapon where name='Tzvia' limit 1),0,0,'');
|
||||||
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
|
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice,icon)
|
||||||
values((select id from weapon_type where name='Rod' limit 1),(select id from weapon where name='Tzvia' limit 1),0,0);
|
values((select id from weapon_type where name='Rod' limit 1),(select id from weapon where name='Tzvia' limit 1),0,0,'');
|
||||||
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
|
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice,icon)
|
||||||
values((select id from weapon_type where name='Talis' limit 1),(select id from weapon where name='Tzvia' limit 1),0,0);
|
values((select id from weapon_type where name='Talis' limit 1),(select id from weapon where name='Tzvia' limit 1),0,0,'');
|
||||||
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
|
insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice,icon)
|
||||||
values((select id from weapon_type where name='Wand' limit 1),(select id from weapon where name='Tzvia' limit 1),0,0);
|
values((select id from weapon_type where name='Wand' limit 1),(select id from weapon where name='Tzvia' limit 1),0,0,'');
|
||||||
|
|
||||||
|
|
||||||
insert into roles(name)
|
insert into roles(name)
|
||||||
|
23
server.js
23
server.js
@ -212,7 +212,8 @@ const ENDPOINTDATA=[
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
app.get(PREFIX+"/databases",(req,res)=>{
|
for (var test of ["","/test"]) {
|
||||||
|
app.get(PREFIX+test+"/databases",(req,res)=>{
|
||||||
db.query('select * from pg_database where datname like \'ngsplanner%\' order by datname desc limit 100')
|
db.query('select * from pg_database where datname like \'ngsplanner%\' order by datname desc limit 100')
|
||||||
.then((data)=>{
|
.then((data)=>{
|
||||||
res.status(200).json(data.rows)
|
res.status(200).json(data.rows)
|
||||||
@ -220,9 +221,9 @@ app.get(PREFIX+"/databases",(req,res)=>{
|
|||||||
.catch((err)=>{
|
.catch((err)=>{
|
||||||
res.status(500).send(err.message)
|
res.status(500).send(err.message)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
app.post(PREFIX+"/databases/restorefrombackup",(req,res)=>{
|
app.post(PREFIX+test+"/databases/restorefrombackup",(req,res)=>{
|
||||||
if (req.body.database) {
|
if (req.body.database) {
|
||||||
db3.query('select * from pg_database where datname=$1',[req.body.database])
|
db3.query('select * from pg_database where datname=$1',[req.body.database])
|
||||||
.then((data)=>{
|
.then((data)=>{
|
||||||
@ -256,9 +257,8 @@ app.post(PREFIX+"/databases/restorefrombackup",(req,res)=>{
|
|||||||
} else {
|
} else {
|
||||||
res.status(500).send("Invalid data!")
|
res.status(500).send("Invalid data!")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
app.post(PREFIX+test+"/databases/testtolive",(req,res)=>{
|
||||||
app.post(PREFIX+"/databases/testtolive",(req,res)=>{
|
|
||||||
db.end(()=>{})
|
db.end(()=>{})
|
||||||
db2.end(()=>{})
|
db2.end(()=>{})
|
||||||
db3.query('select pg_terminate_backend (pid) from pg_stat_activity where pg_stat_activity.datname=\'ngsplanner\' or pg_stat_activity.datname=\'ngsplanner2\'')
|
db3.query('select pg_terminate_backend (pid) from pg_stat_activity where pg_stat_activity.datname=\'ngsplanner\' or pg_stat_activity.datname=\'ngsplanner2\'')
|
||||||
@ -289,9 +289,9 @@ app.post(PREFIX+"/databases/testtolive",(req,res)=>{
|
|||||||
console.log(err.message)
|
console.log(err.message)
|
||||||
res.status(500).send(err.message)
|
res.status(500).send(err.message)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
app.post(PREFIX+"/databases/livetotest",(req,res)=>{
|
app.post(PREFIX+test+"/databases/livetotest",(req,res)=>{
|
||||||
db.end(()=>{})
|
db.end(()=>{})
|
||||||
db2.end(()=>{})
|
db2.end(()=>{})
|
||||||
db3.query('select pg_terminate_backend (pid) from pg_stat_activity where pg_stat_activity.datname=\'ngsplanner\' or pg_stat_activity.datname=\'ngsplanner2\'')
|
db3.query('select pg_terminate_backend (pid) from pg_stat_activity where pg_stat_activity.datname=\'ngsplanner\' or pg_stat_activity.datname=\'ngsplanner2\'')
|
||||||
@ -321,9 +321,9 @@ app.post(PREFIX+"/databases/livetotest",(req,res)=>{
|
|||||||
.catch((err)=>{
|
.catch((err)=>{
|
||||||
res.status(500).send(err.message)
|
res.status(500).send(err.message)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
app.post(PREFIX+"/databases/backup",(req,res)=>{
|
app.post(PREFIX+test+"/databases/backup",(req,res)=>{
|
||||||
db.end(()=>{})
|
db.end(()=>{})
|
||||||
var date = new Date()
|
var date = new Date()
|
||||||
db3.query('select pg_terminate_backend (pid) from pg_stat_activity where pg_stat_activity.datname=\'ngsplanner\'')
|
db3.query('select pg_terminate_backend (pid) from pg_stat_activity where pg_stat_activity.datname=\'ngsplanner\'')
|
||||||
@ -343,7 +343,8 @@ app.post(PREFIX+"/databases/backup",(req,res)=>{
|
|||||||
.catch((err)=>{
|
.catch((err)=>{
|
||||||
res.status(500).send(err.message)
|
res.status(500).send(err.message)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
function CreateDynamicEndpoints() {
|
function CreateDynamicEndpoints() {
|
||||||
ENDPOINTDATA.forEach((endpoint)=>{
|
ENDPOINTDATA.forEach((endpoint)=>{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user