Add skill_tree_data table and all corresponding endpoints and database patches
This commit is contained in:
parent
dcc387f196
commit
f178f34f5a
@ -7,3 +7,6 @@ alter table potential drop column description;
|
|||||||
alter table potential_data add column description text;
|
alter table potential_data add column description text;
|
||||||
alter table photon_art add column icon text;
|
alter table photon_art add column icon text;
|
||||||
alter table users add column recovery_hash text;
|
alter table users add column recovery_hash text;
|
||||||
|
alter table armor rename column pb_gauge_build to slot;
|
||||||
|
CREATE TABLE "skill_tree_data"("id" SERIAL UNIQUE PRIMARY KEY,"class_id" int,"data" text,"skill_data" text,"line_color" text,"line_width" int,"gridsizex" int,"gridsizey" int,"gridpaddingx" int,"gridpaddingy" int);
|
||||||
|
ALTER TABLE "skill_tree_data" ADD FOREIGN KEY ("class_id") REFERENCES "class" ("id");
|
@ -1,15 +1,3 @@
|
|||||||
CREATE TABLE "database_audit" (
|
|
||||||
"id" SERIAL UNIQUE PRIMARY KEY,
|
|
||||||
"action" text,
|
|
||||||
"table_name" text,
|
|
||||||
"row_name" text,
|
|
||||||
"row_id" int,
|
|
||||||
"old_value" text,
|
|
||||||
"new_value" text,
|
|
||||||
"date" timestamptz,
|
|
||||||
"users_id" int
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE TABLE "food_mult" (
|
CREATE TABLE "food_mult" (
|
||||||
"id" SERIAL UNIQUE PRIMARY KEY,
|
"id" SERIAL UNIQUE PRIMARY KEY,
|
||||||
"amount" int,
|
"amount" int,
|
||||||
@ -138,7 +126,7 @@ CREATE TABLE "armor" (
|
|||||||
"shock_res" float,
|
"shock_res" float,
|
||||||
"panic_res" float,
|
"panic_res" float,
|
||||||
"poison_res" float,
|
"poison_res" float,
|
||||||
"battle_power_value" int,
|
"slot" int,
|
||||||
"pb_gauge_build" float,
|
"pb_gauge_build" float,
|
||||||
"icon" text,
|
"icon" text,
|
||||||
"popularity" int,
|
"popularity" int,
|
||||||
@ -206,37 +194,6 @@ CREATE TABLE "skill_type" (
|
|||||||
"name" text
|
"name" text
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE "users" (
|
|
||||||
"id" SERIAL PRIMARY KEY,
|
|
||||||
"username" text UNIQUE,
|
|
||||||
"email" text UNIQUE,
|
|
||||||
"password_hash" text,
|
|
||||||
"created_on" timestamptz,
|
|
||||||
"roles_id" int,
|
|
||||||
"avatar" text,
|
|
||||||
"editors_choice" int,
|
|
||||||
"recovery_hash" text
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE TABLE "roles" (
|
|
||||||
"id" SERIAL UNIQUE PRIMARY KEY,
|
|
||||||
"name" text
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE TABLE "builds" (
|
|
||||||
"id" SERIAL UNIQUE PRIMARY KEY,
|
|
||||||
"users_id" int,
|
|
||||||
"creator" text,
|
|
||||||
"build_name" text,
|
|
||||||
"class1" int,
|
|
||||||
"class2" int,
|
|
||||||
"created_on" timestamptz,
|
|
||||||
"last_modified" timestamptz,
|
|
||||||
"likes" int,
|
|
||||||
"data" text,
|
|
||||||
"editors_choice" int
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE TABLE "weapon_existence_data" (
|
CREATE TABLE "weapon_existence_data" (
|
||||||
"id" SERIAL UNIQUE PRIMARY KEY,
|
"id" SERIAL UNIQUE PRIMARY KEY,
|
||||||
"weapon_type_id" int,
|
"weapon_type_id" int,
|
||||||
@ -306,6 +263,68 @@ CREATE TABLE "class_skill_data" (
|
|||||||
"pb_gauge_fortification" float
|
"pb_gauge_fortification" float
|
||||||
);
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "database_audit" (
|
||||||
|
"id" SERIAL UNIQUE PRIMARY KEY,
|
||||||
|
"action" text,
|
||||||
|
"table_name" text,
|
||||||
|
"row_name" text,
|
||||||
|
"row_id" int,
|
||||||
|
"old_value" text,
|
||||||
|
"new_value" text,
|
||||||
|
"date" timestamptz,
|
||||||
|
"users_id" int
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "users" (
|
||||||
|
"id" SERIAL PRIMARY KEY,
|
||||||
|
"username" text UNIQUE,
|
||||||
|
"email" text UNIQUE,
|
||||||
|
"password_hash" text,
|
||||||
|
"created_on" timestamptz,
|
||||||
|
"roles_id" int,
|
||||||
|
"avatar" text,
|
||||||
|
"editors_choice" int,
|
||||||
|
"recovery_hash" text
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "roles" (
|
||||||
|
"id" SERIAL UNIQUE PRIMARY KEY,
|
||||||
|
"name" text
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "builds" (
|
||||||
|
"id" SERIAL UNIQUE PRIMARY KEY,
|
||||||
|
"users_id" int,
|
||||||
|
"creator" text,
|
||||||
|
"build_name" text,
|
||||||
|
"class1" int,
|
||||||
|
"class2" int,
|
||||||
|
"created_on" timestamptz,
|
||||||
|
"last_modified" timestamptz,
|
||||||
|
"likes" int,
|
||||||
|
"data" text,
|
||||||
|
"editors_choice" int
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "skill_tree_data" (
|
||||||
|
"id" SERIAL UNIQUE PRIMARY KEY,
|
||||||
|
"class_id" int,
|
||||||
|
"data" text,
|
||||||
|
"skill_data" text,
|
||||||
|
"line_color" text,
|
||||||
|
"line_width" int,
|
||||||
|
"gridsizex" int,
|
||||||
|
"gridsizey" int,
|
||||||
|
"gridpaddingx" int,
|
||||||
|
"gridpaddingy" int
|
||||||
|
);
|
||||||
|
|
||||||
|
ALTER TABLE "builds" ADD FOREIGN KEY ("users_id") REFERENCES "users" ("id");
|
||||||
|
|
||||||
|
ALTER TABLE "users" ADD FOREIGN KEY ("roles_id") REFERENCES "roles" ("id");
|
||||||
|
|
||||||
|
ALTER TABLE "database_audit" ADD FOREIGN KEY ("users_id") REFERENCES "users" ("id");
|
||||||
|
|
||||||
ALTER TABLE "class_weapon_type_data" ADD FOREIGN KEY ("class_id") REFERENCES "class" ("id");
|
ALTER TABLE "class_weapon_type_data" ADD FOREIGN KEY ("class_id") REFERENCES "class" ("id");
|
||||||
|
|
||||||
ALTER TABLE "class_level_data" ADD FOREIGN KEY ("class_id") REFERENCES "class" ("id");
|
ALTER TABLE "class_level_data" ADD FOREIGN KEY ("class_id") REFERENCES "class" ("id");
|
||||||
@ -320,24 +339,20 @@ ALTER TABLE "skill_data" ADD FOREIGN KEY ("skill_id") REFERENCES "skill" ("id");
|
|||||||
|
|
||||||
ALTER TABLE "skill" ADD FOREIGN KEY ("skill_type_id") REFERENCES "skill_type" ("id");
|
ALTER TABLE "skill" ADD FOREIGN KEY ("skill_type_id") REFERENCES "skill_type" ("id");
|
||||||
|
|
||||||
ALTER TABLE "builds" ADD FOREIGN KEY ("users_id") REFERENCES "users" ("id");
|
|
||||||
|
|
||||||
ALTER TABLE "builds" ADD FOREIGN KEY ("class1") REFERENCES "class" ("id");
|
|
||||||
|
|
||||||
ALTER TABLE "builds" ADD FOREIGN KEY ("class2") REFERENCES "class" ("id");
|
|
||||||
|
|
||||||
ALTER TABLE "users" ADD FOREIGN KEY ("roles_id") REFERENCES "roles" ("id");
|
|
||||||
|
|
||||||
ALTER TABLE "weapon_existence_data" ADD FOREIGN KEY ("weapon_id") REFERENCES "weapon" ("id");
|
ALTER TABLE "weapon_existence_data" ADD FOREIGN KEY ("weapon_id") REFERENCES "weapon" ("id");
|
||||||
|
|
||||||
ALTER TABLE "weapon_existence_data" ADD FOREIGN KEY ("weapon_type_id") REFERENCES "weapon_type" ("id");
|
ALTER TABLE "weapon_existence_data" ADD FOREIGN KEY ("weapon_type_id") REFERENCES "weapon_type" ("id");
|
||||||
|
|
||||||
ALTER TABLE "augment" ADD FOREIGN KEY ("augment_type_id") REFERENCES "augment_type" ("id");
|
ALTER TABLE "augment" ADD FOREIGN KEY ("augment_type_id") REFERENCES "augment_type" ("id");
|
||||||
|
|
||||||
ALTER TABLE "database_audit" ADD FOREIGN KEY ("users_id") REFERENCES "users" ("id");
|
|
||||||
|
|
||||||
ALTER TABLE "photon_art" ADD FOREIGN KEY ("weapon_type_id") REFERENCES "weapon_type" ("id");
|
ALTER TABLE "photon_art" ADD FOREIGN KEY ("weapon_type_id") REFERENCES "weapon_type" ("id");
|
||||||
|
|
||||||
ALTER TABLE "class_skill_data" ADD FOREIGN KEY ("class_skill_id") REFERENCES "class_skill" ("id");
|
ALTER TABLE "class_skill_data" ADD FOREIGN KEY ("class_skill_id") REFERENCES "class_skill" ("id");
|
||||||
|
|
||||||
ALTER TABLE "class_skill" ADD FOREIGN KEY ("class_id") REFERENCES "class" ("id");
|
ALTER TABLE "class_skill" ADD FOREIGN KEY ("class_id") REFERENCES "class" ("id");
|
||||||
|
|
||||||
|
ALTER TABLE "builds" ADD FOREIGN KEY ("class1") REFERENCES "class" ("id");
|
||||||
|
|
||||||
|
ALTER TABLE "builds" ADD FOREIGN KEY ("class2") REFERENCES "class" ("id");
|
||||||
|
|
||||||
|
ALTER TABLE "skill_tree_data" ADD FOREIGN KEY ("class_id") REFERENCES "class" ("id");
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
delete from skill_tree_data;
|
||||||
delete from class_skill_data;
|
delete from class_skill_data;
|
||||||
delete from class_skill;
|
delete from class_skill;
|
||||||
delete from photon_art;
|
delete from photon_art;
|
||||||
@ -233,12 +234,12 @@ insert into augment(augment_type_id,name,variance,hp,pp,mel_dmg,rng_dmg,tec_dmg,
|
|||||||
insert into augment(augment_type_id,name,variance,hp,pp,mel_dmg,rng_dmg,tec_dmg,crit_rate,crit_dmg,pp_cost_reduction,active_pp_recovery,natural_pp_recovery,dmg_res,affix_success_rate,all_down_res,burn_res,freeze_res,blind_res,shock_res,panic_res,poison_res,battle_power_value,pb_gauge_build,popularity,editors_choice)
|
insert into augment(augment_type_id,name,variance,hp,pp,mel_dmg,rng_dmg,tec_dmg,crit_rate,crit_dmg,pp_cost_reduction,active_pp_recovery,natural_pp_recovery,dmg_res,affix_success_rate,all_down_res,burn_res,freeze_res,blind_res,shock_res,panic_res,poison_res,battle_power_value,pb_gauge_build,popularity,editors_choice)
|
||||||
values((select id from augment_type where name='Precision' limit 1),3,0,0,0,0,1.02,0,0,0,0,0,0,0,0.09,0,0,0,0,0,0,0,6,0,0,0);
|
values((select id from augment_type where name='Precision' limit 1),3,0,0,0,0,1.02,0,0,0,0,0,0,0,0.09,0,0,0,0,0,0,0,6,0,0,0);
|
||||||
|
|
||||||
insert into armor(name,rarity,level_req,def,hp,pp,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,icon,popularity,editors_choice)
|
insert into armor(name,rarity,level_req,def,hp,pp,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,slot,icon,popularity,editors_choice)
|
||||||
values('Primm Armor',1,1,8,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,'/icons/20M6Z7t.png',0,0);
|
values('Primm Armor',1,1,8,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,'/icons/20M6Z7t.png',0,0);
|
||||||
insert into armor(name,rarity,level_req,def,hp,pp,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,icon,popularity,editors_choice)
|
insert into armor(name,rarity,level_req,def,hp,pp,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,slot,icon,popularity,editors_choice)
|
||||||
values('Tzvia Armor',2,1,9,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.2,0,'/icons/F0t58xP.png',0,0);
|
values('Tzvia Armor',2,1,9,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.2,2,'/icons/F0t58xP.png',0,0);
|
||||||
insert into armor(name,rarity,level_req,def,hp,pp,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,icon,popularity,editors_choice)
|
insert into armor(name,rarity,level_req,def,hp,pp,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,slot,icon,popularity,editors_choice)
|
||||||
values('Theseus Armor',3,5,10,10,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.1,0,'/icons/uldt9lR.png',0,0);
|
values('Theseus Armor',3,5,10,10,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.1,3,'/icons/uldt9lR.png',0,0);
|
||||||
|
|
||||||
insert into database_audit(action,table_name,row_name,row_id,old_value,new_value,date,users_id)
|
insert into database_audit(action,table_name,row_name,row_id,old_value,new_value,date,users_id)
|
||||||
values('INSERT','augment','crit_rate',4,'','0.15','2018-07-16 03:30+00',(select id from users where username='sigonasr2' limit 1));
|
values('INSERT','augment','crit_rate',4,'','0.15','2018-07-16 03:30+00',(select id from users where username='sigonasr2' limit 1));
|
||||||
@ -274,3 +275,6 @@ insert into class_skill_data(name,class_skill_id,dependency,level,effect,duratio
|
|||||||
values('War Cry Lv.2',(SELECT id from class_skill WHERE name='War Cry' limit 1),'',2,'Effect Name',11,11,0.8,1.0,false,0.7,'',0,0,0,0.9,0,0,0,0,0);
|
values('War Cry Lv.2',(SELECT id from class_skill WHERE name='War Cry' limit 1),'',2,'Effect Name',11,11,0.8,1.0,false,0.7,'',0,0,0,0.9,0,0,0,0,0);
|
||||||
insert into class_skill_data(name,class_skill_id,dependency,level,effect,duration,cooldown,damage_taken,pa_potency,conditional_buff,pp_recovery,property,all_damage_buff,active_pp_recovery,status_ailment_accum,status_ailment_duration,pp_consumption,max_hp_decrease,natural_pp_recovery,added_pp,pb_gauge_fortification)
|
insert into class_skill_data(name,class_skill_id,dependency,level,effect,duration,cooldown,damage_taken,pa_potency,conditional_buff,pp_recovery,property,all_damage_buff,active_pp_recovery,status_ailment_accum,status_ailment_duration,pp_consumption,max_hp_decrease,natural_pp_recovery,added_pp,pb_gauge_fortification)
|
||||||
values('Assault Charge Advent',(SELECT id from class_skill WHERE name='Assault Charge Advent' limit 1),'',1,'Effect Name',30,24,1.0,1.1,false,0.8,'',0,0,0,0,0,0,0.6,0,0);
|
values('Assault Charge Advent',(SELECT id from class_skill WHERE name='Assault Charge Advent' limit 1),'',1,'Effect Name',30,24,1.0,1.1,false,0.8,'',0,0,0,0,0,0,0.6,0,0);
|
||||||
|
|
||||||
|
insert into skill_tree_data(class_id,data,skill_data,line_color,line_width,gridsizex,gridsizey,gridpaddingx,gridpaddingy)
|
||||||
|
values((select id from class where name='Hunter'),'□ □ ,└□─┘□□, │ ││, │ □│, □─□┼□, □ ','','#000000',3,80,60,10,10);
|
14
server.js
14
server.js
@ -122,7 +122,7 @@ const ENDPOINTDATA=[
|
|||||||
{
|
{
|
||||||
endpoint:"armor",
|
endpoint:"armor",
|
||||||
requiredfields:["name","rarity","level_req","def"],
|
requiredfields:["name","rarity","level_req","def"],
|
||||||
optionalfields:["hp","pp","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","icon","popularity","editors_choice"],
|
optionalfields:["hp","pp","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","slot","icon","popularity","editors_choice"],
|
||||||
excludedfields:[] //Fields to not output in GET.
|
excludedfields:[] //Fields to not output in GET.
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -220,6 +220,12 @@ const ENDPOINTDATA=[
|
|||||||
requiredfields:["action","table_name","row_name","row_id","new_value","date","users_id"],
|
requiredfields:["action","table_name","row_name","row_id","new_value","date","users_id"],
|
||||||
optionalfields:["old_value"],
|
optionalfields:["old_value"],
|
||||||
excludedfields:[] //Fields to not output in GET.
|
excludedfields:[] //Fields to not output in GET.
|
||||||
|
},
|
||||||
|
{
|
||||||
|
endpoint:"skill_tree_data",
|
||||||
|
requiredfields:["class_id","data","skill_data","line_color","line_width","gridsizex","gridsizey","gridpaddingx","gridpaddingy"],
|
||||||
|
optionalfields:[],
|
||||||
|
excludedfields:[] //Fields to not output in GET.
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -382,11 +388,11 @@ for (var test of ["","/test"]) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
app.post(PREFIX+test+"/databases/backup",(req,res)=>{
|
app.post(PREFIX+test+"/databases/backup",(req,res)=>{
|
||||||
|
var date = new Date()
|
||||||
db4.query('select * from password where password=$1',[req.body.pass])
|
db4.query('select * from password where password=$1',[req.body.pass])
|
||||||
.then((data)=>{
|
.then((data)=>{
|
||||||
if (data.rows.length>0) {
|
if (data.rows.length>0) {
|
||||||
db.end(()=>{})
|
db.end(()=>{})
|
||||||
var date = new Date()
|
|
||||||
return db3.query('select pg_terminate_backend (pid) from pg_stat_activity where pg_stat_activity.datname=\'ngsplanner\'')
|
return db3.query('select pg_terminate_backend (pid) from pg_stat_activity where pg_stat_activity.datname=\'ngsplanner\'')
|
||||||
} else {
|
} else {
|
||||||
var msg="Could not authenticate!";res.status(500).send(msg);throw msg
|
var msg="Could not authenticate!";res.status(500).send(msg);throw msg
|
||||||
@ -791,8 +797,8 @@ app.get(PREFIX+'/test/dataid',async(req,res)=>{
|
|||||||
})
|
})
|
||||||
|
|
||||||
app.post(PREFIX+"/validUser",(req,res)=>{
|
app.post(PREFIX+"/validUser",(req,res)=>{
|
||||||
console.log(sh.SecretHash("test"))
|
//console.log(sh.SecretHash("098f6bcd4621d373cade4e832627b4f6"))
|
||||||
db.query('select * from users where username=$1 and password_hash=$2 limit 1',[req.body.username,req.body.password])
|
db.query('select * from users where username=$1 and password_hash=$2 limit 1',[req.body.username,sh.SecretHash(req.body.password)])
|
||||||
.then((data)=>{
|
.then((data)=>{
|
||||||
if (data.rows.length>0) {
|
if (data.rows.length>0) {
|
||||||
res.status(200).json({verified:true})
|
res.status(200).json({verified:true})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user