Implement new schema

pull/1/head
sigonasr2 3 years ago
parent 2dcbc472ec
commit 58d3dc87f8
  1. 36
      ngsplanner_schema.sql
  2. 214
      ngsplanner_seed.sql
  3. 22
      server.js

@ -21,7 +21,9 @@ CREATE TABLE "food" (
"pp_consumption" boolean, "pp_consumption" boolean,
"pp_recovery" boolean, "pp_recovery" boolean,
"weak_point_dmg" boolean, "weak_point_dmg" boolean,
"hp_recovery" boolean "hp_recovery" boolean,
"popularity" int,
"editors_choice" int
); );
CREATE TABLE "class" ( CREATE TABLE "class" (
@ -121,13 +123,15 @@ CREATE TABLE "armor" (
"poison_res" float, "poison_res" float,
"battle_power_value" int, "battle_power_value" int,
"pb_gauge_build" float, "pb_gauge_build" float,
"icon" text "icon" text,
"popularity" int,
"editors_choice" int
); );
CREATE TABLE "augment" ( CREATE TABLE "augment" (
"id" SERIAL UNIQUE PRIMARY KEY, "id" SERIAL UNIQUE PRIMARY KEY,
"augment_type_id" int, "augment_type_id" int,
"level" int, "name" text,
"variance" float, "variance" float,
"hp" int, "hp" int,
"pp" int, "pp" int,
@ -149,7 +153,9 @@ CREATE TABLE "augment" (
"panic_res" float, "panic_res" float,
"poison_res" float, "poison_res" float,
"battle_power_value" int, "battle_power_value" int,
"pb_gauge_build" float "pb_gauge_build" float,
"popularity" int,
"editors_choice" int
); );
CREATE TABLE "skill" ( CREATE TABLE "skill" (
@ -172,7 +178,9 @@ CREATE TABLE "skill_data" (
"pp_cost_reduction" float, "pp_cost_reduction" float,
"active_pp_recovery" float, "active_pp_recovery" float,
"natural_pp_recovery" float, "natural_pp_recovery" float,
"dmg_res" float "dmg_res" float,
"popularity" int,
"editors_choice" int
); );
CREATE TABLE "skill_type" ( CREATE TABLE "skill_type" (
@ -186,8 +194,9 @@ CREATE TABLE "users" (
"email" text UNIQUE, "email" text UNIQUE,
"password_hash" text, "password_hash" text,
"created_on" timestamptz, "created_on" timestamptz,
"role_id" int, "roles_id" int,
"avatar" text "avatar" text,
"editors_choice" int
); );
CREATE TABLE "roles" ( CREATE TABLE "roles" (
@ -197,7 +206,7 @@ CREATE TABLE "roles" (
CREATE TABLE "builds" ( CREATE TABLE "builds" (
"id" SERIAL UNIQUE PRIMARY KEY, "id" SERIAL UNIQUE PRIMARY KEY,
"user_id" int, "users_id" int,
"creator" text, "creator" text,
"build_name" text, "build_name" text,
"class1" int, "class1" int,
@ -205,13 +214,16 @@ CREATE TABLE "builds" (
"created_on" timestamptz, "created_on" timestamptz,
"last_modified" timestamptz, "last_modified" timestamptz,
"likes" int, "likes" int,
"data" text "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,
"weapon_id" int "weapon_id" int,
"popularity" int,
"editors_choice" int
); );
CREATE TABLE "augment_type" ( CREATE TABLE "augment_type" (
@ -234,13 +246,13 @@ 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 ("user_id") REFERENCES "users" ("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 ("class1") REFERENCES "class" ("id");
ALTER TABLE "builds" ADD FOREIGN KEY ("class2") REFERENCES "class" ("id"); ALTER TABLE "builds" ADD FOREIGN KEY ("class2") REFERENCES "class" ("id");
ALTER TABLE "users" ADD FOREIGN KEY ("role_id") REFERENCES "roles" ("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");

@ -6,10 +6,10 @@ insert into food_mult(amount,potency,pp,dmg_res,hp,pp_consumption,pp_recovery,we
insert into food_mult(amount,potency,pp,dmg_res,hp,pp_consumption,pp_recovery,weak_point_dmg,hp_recovery) insert into food_mult(amount,potency,pp,dmg_res,hp,pp_consumption,pp_recovery,weak_point_dmg,hp_recovery)
values(1,1.05,10,1.05,1.05,1,1,1,1); values(1,1.05,10,1.05,1.05,1,1,1,1);
insert into food(material,potency,pp,dmg_res,hp,pp_consumption,pp_recovery,weak_point_dmg,hp_recovery) insert into food(material,potency,pp,dmg_res,hp,pp_consumption,pp_recovery,weak_point_dmg,hp_recovery,popularity,editors_choice)
values('Rich Aelio Meat',true,false,false,false,true,false,false,false); values('Rich Aelio Meat',true,false,false,false,true,false,false,false,0,0);
insert into food(material,potency,pp,dmg_res,hp,pp_consumption,pp_recovery,weak_point_dmg,hp_recovery) insert into food(material,potency,pp,dmg_res,hp,pp_consumption,pp_recovery,weak_point_dmg,hp_recovery,popularity,editors_choice)
values('Light Aelio Meat',true,false,false,false,false,true,false,false); values('Light Aelio Meat',true,false,false,false,false,true,false,false,0,0);
insert into class(name,icon) values('Hunter','/icons/UINGSClassHu.png'); insert into class(name,icon) values('Hunter','/icons/UINGSClassHu.png');
insert into class(name,icon) values('Fighter','/icons/UINGSClassFi.png'); insert into class(name,icon) values('Fighter','/icons/UINGSClassFi.png');
@ -80,54 +80,54 @@ insert into potential_data(potential_id,level,mel_dmg,rng_dmg,tec_dmg,crit_rate,
insert into potential_data(potential_id,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,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'),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'),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) insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
values((select id from weapon_type where name='Sword'),(select id from weapon where name='Primm')); values((select id from weapon_type where name='Sword'),(select id from weapon where name='Primm'),0,0);
insert into weapon_existence_data(weapon_type_id,weapon_id) insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
values((select id from weapon_type where name='Spear'),(select id from weapon where name='Primm')); values((select id from weapon_type where name='Spear'),(select id from weapon where name='Primm'),0,0);
insert into weapon_existence_data(weapon_type_id,weapon_id) insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
values((select id from weapon_type where name='Wired Lance'),(select id from weapon where name='Primm')); values((select id from weapon_type where name='Wired Lance'),(select id from weapon where name='Primm'),0,0);
insert into weapon_existence_data(weapon_type_id,weapon_id) insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
values((select id from weapon_type where name='Twin Dagger'),(select id from weapon where name='Primm')); values((select id from weapon_type where name='Twin Dagger'),(select id from weapon where name='Primm'),0,0);
insert into weapon_existence_data(weapon_type_id,weapon_id) insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
values((select id from weapon_type where name='Double Saber'),(select id from weapon where name='Primm')); values((select id from weapon_type where name='Double Saber'),(select id from weapon where name='Primm'),0,0);
insert into weapon_existence_data(weapon_type_id,weapon_id) insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
values((select id from weapon_type where name='Knuckles'),(select id from weapon where name='Primm')); values((select id from weapon_type where name='Knuckles'),(select id from weapon where name='Primm'),0,0);
insert into weapon_existence_data(weapon_type_id,weapon_id) insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
values((select id from weapon_type where name='Assault Rifle'),(select id from weapon where name='Primm')); values((select id from weapon_type where name='Assault Rifle'),(select id from weapon where name='Primm'),0,0);
insert into weapon_existence_data(weapon_type_id,weapon_id) insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
values((select id from weapon_type where name='Launcher'),(select id from weapon where name='Primm')); values((select id from weapon_type where name='Launcher'),(select id from weapon where name='Primm'),0,0);
insert into weapon_existence_data(weapon_type_id,weapon_id) insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
values((select id from weapon_type where name='Twin Machine Guns'),(select id from weapon where name='Primm')); values((select id from weapon_type where name='Twin Machine Guns'),(select id from weapon where name='Primm'),0,0);
insert into weapon_existence_data(weapon_type_id,weapon_id) insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
values((select id from weapon_type where name='Rod'),(select id from weapon where name='Primm')); values((select id from weapon_type where name='Rod'),(select id from weapon where name='Primm'),0,0);
insert into weapon_existence_data(weapon_type_id,weapon_id) insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
values((select id from weapon_type where name='Talis'),(select id from weapon where name='Primm')); values((select id from weapon_type where name='Talis'),(select id from weapon where name='Primm'),0,0);
insert into weapon_existence_data(weapon_type_id,weapon_id) insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
values((select id from weapon_type where name='Wand'),(select id from weapon where name='Primm')); values((select id from weapon_type where name='Wand'),(select id from weapon where name='Primm'),0,0);
insert into weapon_existence_data(weapon_type_id,weapon_id) insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
values((select id from weapon_type where name='Sword'),(select id from weapon where name='Tzvia')); values((select id from weapon_type where name='Sword'),(select id from weapon where name='Tzvia'),0,0);
insert into weapon_existence_data(weapon_type_id,weapon_id) insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
values((select id from weapon_type where name='Spear'),(select id from weapon where name='Tzvia')); values((select id from weapon_type where name='Spear'),(select id from weapon where name='Tzvia'),0,0);
insert into weapon_existence_data(weapon_type_id,weapon_id) insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
values((select id from weapon_type where name='Wired Lance'),(select id from weapon where name='Tzvia')); values((select id from weapon_type where name='Wired Lance'),(select id from weapon where name='Tzvia'),0,0);
insert into weapon_existence_data(weapon_type_id,weapon_id) insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
values((select id from weapon_type where name='Twin Dagger'),(select id from weapon where name='Tzvia')); values((select id from weapon_type where name='Twin Dagger'),(select id from weapon where name='Tzvia'),0,0);
insert into weapon_existence_data(weapon_type_id,weapon_id) insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
values((select id from weapon_type where name='Double Saber'),(select id from weapon where name='Tzvia')); values((select id from weapon_type where name='Double Saber'),(select id from weapon where name='Tzvia'),0,0);
insert into weapon_existence_data(weapon_type_id,weapon_id) insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
values((select id from weapon_type where name='Knuckles'),(select id from weapon where name='Tzvia')); values((select id from weapon_type where name='Knuckles'),(select id from weapon where name='Tzvia'),0,0);
insert into weapon_existence_data(weapon_type_id,weapon_id) insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
values((select id from weapon_type where name='Assault Rifle'),(select id from weapon where name='Tzvia')); values((select id from weapon_type where name='Assault Rifle'),(select id from weapon where name='Tzvia'),0,0);
insert into weapon_existence_data(weapon_type_id,weapon_id) insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
values((select id from weapon_type where name='Launcher'),(select id from weapon where name='Tzvia')); values((select id from weapon_type where name='Launcher'),(select id from weapon where name='Tzvia'),0,0);
insert into weapon_existence_data(weapon_type_id,weapon_id) insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
values((select id from weapon_type where name='Twin Machine Guns'),(select id from weapon where name='Tzvia')); values((select id from weapon_type where name='Twin Machine Guns'),(select id from weapon where name='Tzvia'),0,0);
insert into weapon_existence_data(weapon_type_id,weapon_id) insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
values((select id from weapon_type where name='Rod'),(select id from weapon where name='Tzvia')); values((select id from weapon_type where name='Rod'),(select id from weapon where name='Tzvia'),0,0);
insert into weapon_existence_data(weapon_type_id,weapon_id) insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
values((select id from weapon_type where name='Talis'),(select id from weapon where name='Tzvia')); values((select id from weapon_type where name='Talis'),(select id from weapon where name='Tzvia'),0,0);
insert into weapon_existence_data(weapon_type_id,weapon_id) insert into weapon_existence_data(weapon_type_id,weapon_id,popularity,editors_choice)
values((select id from weapon_type where name='Wand'),(select id from weapon where name='Tzvia')); values((select id from weapon_type where name='Wand'),(select id from weapon where name='Tzvia'),0,0);
insert into roles(name) insert into roles(name)
@ -137,15 +137,15 @@ insert into roles(name)
insert into roles(name) insert into roles(name)
values('Guest'); values('Guest');
insert into users(username,email,password_hash,created_on,role_id,avatar) insert into users(username,email,password_hash,created_on,roles_id,avatar)
values('sigonasr2','sigonasr2@gmail.com','ABCDEFG','2021-07-13 04:30+00',(select id from roles where name='Administrator'),''); values('sigonasr2','sigonasr2@gmail.com','ABCDEFG','2021-07-13 04:30+00',(select id from roles where name='Administrator'),'');
insert into users(username,email,password_hash,created_on,role_id,avatar) insert into users(username,email,password_hash,created_on,roles_id,avatar)
values('sigonasr3','sigonasr3@gmail.com','ABCDEF','2021-07-14 05:30+00',(select id from roles where name='Editor'),''); values('sigonasr3','sigonasr3@gmail.com','ABCDEF','2021-07-14 05:30+00',(select id from roles where name='Editor'),'');
insert into builds(user_id,creator,build_name,class1,class2,created_on,last_modified,likes,data) insert into builds(users_id,creator,build_name,class1,class2,created_on,last_modified,likes,data,editors_choice)
values((select id from users where username='sigonasr2'),'sigonasr2','Test Build',(select id from class where name='Ranger'),(select id from class where name='Force'),'2021-07-13 04:30+00','2021-07-13 04:30+00',5,'<DATA STRING>'); values((select id from users where username='sigonasr2'),'sigonasr2','Test Build',(select id from class where name='Ranger'),(select id from class where name='Force'),'2021-07-13 04:30+00','2021-07-13 04:30+00',5,'<DATA STRING>',0);
insert into builds(user_id,creator,build_name,class1,class2,created_on,last_modified,likes,data) insert into builds(users_id,creator,build_name,class1,class2,created_on,last_modified,likes,data,editors_choice)
values((select id from users where username='sigonasr3'),'sigonasr3','Test Build2',(select id from class where name='Techter'),(select id from class where name='Fighter'),'2021-07-13 06:30+00','2021-07-13 07:30+00',27,'<DATA STRING>'); values((select id from users where username='sigonasr3'),'sigonasr3','Test Build2',(select id from class where name='Techter'),(select id from class where name='Fighter'),'2021-07-13 06:30+00','2021-07-13 07:30+00',27,'<DATA STRING>',0);
insert into skill_type(name) insert into skill_type(name)
values('Weapon'); values('Weapon');
@ -159,24 +159,24 @@ insert into skill(name,skill_type_id,icon)
insert into skill(name,skill_type_id,icon) insert into skill(name,skill_type_id,icon)
values('Fixa Termina',(select id from skill_type where name='Weapon'),'/icons/UINGSItemPresetAbility.png'); values('Fixa Termina',(select id from skill_type where name='Weapon'),'/icons/UINGSItemPresetAbility.png');
insert into skill_data(skill_id,level,variance,mel_dmg,rng_dmg,tec_dmg,crit_rate,crit_dmg,pp_cost_reduction,active_pp_recovery,natural_pp_recovery,dmg_res) insert into skill_data(skill_id,level,variance,mel_dmg,rng_dmg,tec_dmg,crit_rate,crit_dmg,pp_cost_reduction,active_pp_recovery,natural_pp_recovery,dmg_res,popularity,editors_choice)
values((select id from skill where name='Fixa Attack'),1,0,1.02,1.02,1.02,0,0,0,0,0,0); values((select id from skill where name='Fixa Attack'),1,0,1.02,1.02,1.02,0,0,0,0,0,0,0,0);
insert into skill_data(skill_id,level,variance,mel_dmg,rng_dmg,tec_dmg,crit_rate,crit_dmg,pp_cost_reduction,active_pp_recovery,natural_pp_recovery,dmg_res) insert into skill_data(skill_id,level,variance,mel_dmg,rng_dmg,tec_dmg,crit_rate,crit_dmg,pp_cost_reduction,active_pp_recovery,natural_pp_recovery,dmg_res,popularity,editors_choice)
values((select id from skill where name='Fixa Attack'),2,0,1.03,1.03,1.03,0,0,0,0,0,0); values((select id from skill where name='Fixa Attack'),2,0,1.03,1.03,1.03,0,0,0,0,0,0,0,0);
insert into skill_data(skill_id,level,variance,mel_dmg,rng_dmg,tec_dmg,crit_rate,crit_dmg,pp_cost_reduction,active_pp_recovery,natural_pp_recovery,dmg_res) insert into skill_data(skill_id,level,variance,mel_dmg,rng_dmg,tec_dmg,crit_rate,crit_dmg,pp_cost_reduction,active_pp_recovery,natural_pp_recovery,dmg_res,popularity,editors_choice)
values((select id from skill where name='Fixa Attack'),3,0,1.04,1.04,1.04,0,0,0,0,0,0); values((select id from skill where name='Fixa Attack'),3,0,1.04,1.04,1.04,0,0,0,0,0,0,0,0);
insert into skill_data(skill_id,level,variance,mel_dmg,rng_dmg,tec_dmg,crit_rate,crit_dmg,pp_cost_reduction,active_pp_recovery,natural_pp_recovery,dmg_res) insert into skill_data(skill_id,level,variance,mel_dmg,rng_dmg,tec_dmg,crit_rate,crit_dmg,pp_cost_reduction,active_pp_recovery,natural_pp_recovery,dmg_res,popularity,editors_choice)
values((select id from skill where name='Fixa Guard'),1,0,0,0,0,0,0,0,0,0,1.01); values((select id from skill where name='Fixa Guard'),1,0,0,0,0,0,0,0,0,0,1.01,0,0);
insert into skill_data(skill_id,level,variance,mel_dmg,rng_dmg,tec_dmg,crit_rate,crit_dmg,pp_cost_reduction,active_pp_recovery,natural_pp_recovery,dmg_res) insert into skill_data(skill_id,level,variance,mel_dmg,rng_dmg,tec_dmg,crit_rate,crit_dmg,pp_cost_reduction,active_pp_recovery,natural_pp_recovery,dmg_res,popularity,editors_choice)
values((select id from skill where name='Fixa Guard'),2,0,0,0,0,0,0,0,0,0,1.02); values((select id from skill where name='Fixa Guard'),2,0,0,0,0,0,0,0,0,0,1.02,0,0);
insert into skill_data(skill_id,level,variance,mel_dmg,rng_dmg,tec_dmg,crit_rate,crit_dmg,pp_cost_reduction,active_pp_recovery,natural_pp_recovery,dmg_res) insert into skill_data(skill_id,level,variance,mel_dmg,rng_dmg,tec_dmg,crit_rate,crit_dmg,pp_cost_reduction,active_pp_recovery,natural_pp_recovery,dmg_res,popularity,editors_choice)
values((select id from skill where name='Fixa Guard'),3,0,0,0,0,0,0,0,0,0,1.03); values((select id from skill where name='Fixa Guard'),3,0,0,0,0,0,0,0,0,0,1.03,0,0);
insert into skill_data(skill_id,level,variance,mel_dmg,rng_dmg,tec_dmg,crit_rate,crit_dmg,pp_cost_reduction,active_pp_recovery,natural_pp_recovery,dmg_res) insert into skill_data(skill_id,level,variance,mel_dmg,rng_dmg,tec_dmg,crit_rate,crit_dmg,pp_cost_reduction,active_pp_recovery,natural_pp_recovery,dmg_res,popularity,editors_choice)
values((select id from skill where name='Fixa Termina'),1,0,0,0,0,0,1.05,0,0,0,0); values((select id from skill where name='Fixa Termina'),1,0,0,0,0,0,1.05,0,0,0,0,0,0);
insert into skill_data(skill_id,level,variance,mel_dmg,rng_dmg,tec_dmg,crit_rate,crit_dmg,pp_cost_reduction,active_pp_recovery,natural_pp_recovery,dmg_res) insert into skill_data(skill_id,level,variance,mel_dmg,rng_dmg,tec_dmg,crit_rate,crit_dmg,pp_cost_reduction,active_pp_recovery,natural_pp_recovery,dmg_res,popularity,editors_choice)
values((select id from skill where name='Fixa Termina'),2,0,0,0,0,0,1.08,0,0,0,0); values((select id from skill where name='Fixa Termina'),2,0,0,0,0,0,1.08,0,0,0,0,0,0);
insert into skill_data(skill_id,level,variance,mel_dmg,rng_dmg,tec_dmg,crit_rate,crit_dmg,pp_cost_reduction,active_pp_recovery,natural_pp_recovery,dmg_res) insert into skill_data(skill_id,level,variance,mel_dmg,rng_dmg,tec_dmg,crit_rate,crit_dmg,pp_cost_reduction,active_pp_recovery,natural_pp_recovery,dmg_res,popularity,editors_choice)
values((select id from skill where name='Fixa Termina'),3,0,0,0,0,0,1.10,0,0,0,0); values((select id from skill where name='Fixa Termina'),3,0,0,0,0,0,1.10,0,0,0,0,0,0);
insert into augment_type(name,icon) insert into augment_type(name,icon)
values('Stamina',''); values('Stamina','');
@ -187,34 +187,34 @@ insert into augment_type(name,icon)
insert into augment_type(name,icon) insert into augment_type(name,icon)
values('Precision',''); values('Precision','');
insert into augment(augment_type_id,level,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) 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='Stamina'),1,0,5,0,0,0,0,0,0,0,0,0,0,0.1,0,0,0,0,0,0,0,3,0); values((select id from augment_type where name='Stamina'),1,0,5,0,0,0,0,0,0,0,0,0,0,0.1,0,0,0,0,0,0,0,3,0,0,0);
insert into augment(augment_type_id,level,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) 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='Stamina'),2,0,10,0,0,0,0,0,0,0,0,0,0,0.1,0,0,0,0,0,0,0,4,0); values((select id from augment_type where name='Stamina'),2,0,10,0,0,0,0,0,0,0,0,0,0,0.1,0,0,0,0,0,0,0,4,0,0,0);
insert into augment(augment_type_id,level,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) 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='Stamina'),3,0,15,0,0,0,0,0,0,0,0,0,0,0.09,0,0,0,0,0,0,0,5,0); values((select id from augment_type where name='Stamina'),3,0,15,0,0,0,0,0,0,0,0,0,0,0.09,0,0,0,0,0,0,0,5,0,0,0);
insert into augment(augment_type_id,level,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) 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='Spirit'),1,0,0,3,0,0,0,0,0,0,0,0,0,0.1,0,0,0,0,0,0,0,2,0); values((select id from augment_type where name='Spirit'),1,0,0,3,0,0,0,0,0,0,0,0,0,0.1,0,0,0,0,0,0,0,2,0,0,0);
insert into augment(augment_type_id,level,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) 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='Spirit'),2,0,0,4,0,0,0,0,0,0,0,0,0,0.1,0,0,0,0,0,0,0,3,0); values((select id from augment_type where name='Spirit'),2,0,0,4,0,0,0,0,0,0,0,0,0,0.1,0,0,0,0,0,0,0,3,0,0,0);
insert into augment(augment_type_id,level,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) 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='Spirit'),3,0,0,5,0,0,0,0,0,0,0,0,0,0.09,0,0,0,0,0,0,0,4,0); values((select id from augment_type where name='Spirit'),3,0,0,5,0,0,0,0,0,0,0,0,0,0.09,0,0,0,0,0,0,0,4,0,0,0);
insert into augment(augment_type_id,level,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) 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='Might'),1,0,0,0,1.01,0,0,0,0,0,0,0,0,0.1,0,0,0,0,0,0,0,4,0); values((select id from augment_type where name='Might'),1,0,0,0,1.01,0,0,0,0,0,0,0,0,0.1,0,0,0,0,0,0,0,4,0,0,0);
insert into augment(augment_type_id,level,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) 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='Might'),2,0,0,0,1.015,0,0,0,0,0,0,0,0,0.1,0,0,0,0,0,0,0,5,0); values((select id from augment_type where name='Might'),2,0,0,0,1.015,0,0,0,0,0,0,0,0,0.1,0,0,0,0,0,0,0,5,0,0,0);
insert into augment(augment_type_id,level,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) 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='Might'),3,0,0,0,1.02,0,0,0,0,0,0,0,0,0.09,0,0,0,0,0,0,0,6,0); values((select id from augment_type where name='Might'),3,0,0,0,1.02,0,0,0,0,0,0,0,0,0.09,0,0,0,0,0,0,0,6,0,0,0);
insert into augment(augment_type_id,level,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) 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'),1,0,0,0,0,1.01,0,0,0,0,0,0,0,0.1,0,0,0,0,0,0,0,4,0); values((select id from augment_type where name='Precision'),1,0,0,0,0,1.01,0,0,0,0,0,0,0,0.1,0,0,0,0,0,0,0,4,0,0,0);
insert into augment(augment_type_id,level,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) 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'),2,0,0,0,0,1.015,0,0,0,0,0,0,0,0.1,0,0,0,0,0,0,0,5,0); values((select id from augment_type where name='Precision'),2,0,0,0,0,1.015,0,0,0,0,0,0,0,0.1,0,0,0,0,0,0,0,5,0,0,0);
insert into augment(augment_type_id,level,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) 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'),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); values((select id from augment_type where name='Precision'),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) 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)
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'); 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);
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) 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)
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'); 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);
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) 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)
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'); 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);

@ -73,7 +73,7 @@ const ENDPOINTDATA=[
{ {
endpoint:"weapon_existence_data", endpoint:"weapon_existence_data",
requiredfields:["weapon_type_id","weapon_id"], requiredfields:["weapon_type_id","weapon_id"],
optionalfields:[], optionalfields:["popularity","editors_choice"],
excludedfields:[] //Fields to not output in GET. excludedfields:[] //Fields to not output in GET.
}, },
{ {
@ -85,7 +85,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"], 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"],
excludedfields:[] //Fields to not output in GET. excludedfields:[] //Fields to not output in GET.
}, },
{ {
@ -102,8 +102,8 @@ const ENDPOINTDATA=[
}, },
{ {
endpoint:"builds", endpoint:"builds",
requiredfields:["user_id","creator","build_name","class1","created_on","last_modified","data"], requiredfields:["users_id","creator","build_name","class1","created_on","last_modified","data"],
optionalfields:["class2","likes"], optionalfields:["class2","likes","editors_choice"],
excludedfields:[] //Fields to not output in GET. excludedfields:[] //Fields to not output in GET.
}, },
{ {
@ -121,13 +121,13 @@ const ENDPOINTDATA=[
{ {
endpoint:"skill_data", endpoint:"skill_data",
requiredfields:["skill_id","level"], requiredfields:["skill_id","level"],
optionalfields:["variance","mel_dmg","rng_dmg","tec_dmg","crit_rate","crit_dmg","pp_cost_reduction","active_pp_recovery","natural_pp_recovery","dmg_res"], optionalfields:["variance","mel_dmg","rng_dmg","tec_dmg","crit_rate","crit_dmg","pp_cost_reduction","active_pp_recovery","natural_pp_recovery","dmg_res","popularity","editors_choice"],
excludedfields:[] //Fields to not output in GET. excludedfields:[] //Fields to not output in GET.
}, },
{ {
endpoint:"augment", endpoint:"augment",
requiredfields:["augment_type_id","level"], requiredfields:["augment_type_id","level"],
optionalfields:["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"], optionalfields:["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"],
excludedfields:[] //Fields to not output in GET. excludedfields:[] //Fields to not output in GET.
}, },
{ {
@ -139,7 +139,7 @@ const ENDPOINTDATA=[
{ {
endpoint:"food", endpoint:"food",
requiredfields:["material"], requiredfields:["material"],
optionalfields:["potency","pp","dmg_res","hp","pp_consumption","pp_recovery","weak_point_dmg","hp_recovery"], optionalfields:["potency","pp","dmg_res","hp","pp_consumption","pp_recovery","weak_point_dmg","hp_recovery","popularity","editors_choice"],
excludedfields:[] //Fields to not output in GET. excludedfields:[] //Fields to not output in GET.
}, },
{ {
@ -156,8 +156,8 @@ const ENDPOINTDATA=[
}, },
{ {
endpoint:"users", endpoint:"users",
requiredfields:["username","email","created_on","role_id"], requiredfields:["username","email","created_on","roles_id"],
optionalfields:["avatar"], optionalfields:["avatar","editors_choice"],
excludedfields:["password_hash"] //Fields to not output in GET. excludedfields:["password_hash"] //Fields to not output in GET.
} }
] ]
@ -261,10 +261,10 @@ app.get('/data',(req,res)=>{
}) })
.then((data)=>{ .then((data)=>{
finalresult["class_level_data"]=CleanUp(data.rows,["id","class_id","name"]) finalresult["class_level_data"]=CleanUp(data.rows,["id","class_id","name"])
return db.query('select *,class.name as class2 from (select *,class.name as class1 from builds inner join users on users.id=builds.user_id inner join class on class.id=builds.class1)t inner join class on class.id=t.class2') return db.query('select *,class.name as class2 from (select *,class.name as class1 from builds inner join users on users.id=builds.users_id inner join class on class.id=builds.class1)t inner join class on class.id=t.class2')
}) })
.then((data)=>{ .then((data)=>{
finalresult["builds"]=CleanUp(data.rows,["id","user_id","username","email","password_hash","created_on","role_id","name"]) finalresult["builds"]=CleanUp(data.rows,["id","users_id","username","email","password_hash","created_on","roles_id","name"])
return db.query('select *,skill.name as skill_name,skill_type.name as skill_type_name from skill_data inner join skill on skill.id=skill_data.skill_id inner join skill_type on skill.skill_type_id=skill_type.id') return db.query('select *,skill.name as skill_name,skill_type.name as skill_type_name from skill_data inner join skill on skill.id=skill_data.skill_id inner join skill_type on skill.skill_type_id=skill_type.id')
}) })
.then((data)=>{ .then((data)=>{

Loading…
Cancel
Save