From 5cfdd6c9d6d40b0af44e9d7ec538e18804517a8c Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Fri, 10 Sep 2021 04:14:42 -0500 Subject: [PATCH] Add rarity field in database --- ngsplanner_patch.sql | 3 ++- ngsplanner_schema.sql | 9 +++++---- ngsplanner_seed.sql | 8 ++++---- server.js | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/ngsplanner_patch.sql b/ngsplanner_patch.sql index 42fc84d..ec80bf1 100644 --- a/ngsplanner_patch.sql +++ b/ngsplanner_patch.sql @@ -2,4 +2,5 @@ CREATE TABLE "element" ("id" SERIAL UNIQUE PRIMARY KEY,"name" text); alter table augment add column element_id int; alter table augment add column icon text; -alter table augment_type drop column icon; \ No newline at end of file +alter table augment_type drop column icon; +alter table food add column rarity int; \ No newline at end of file diff --git a/ngsplanner_schema.sql b/ngsplanner_schema.sql index 4e5d07b..22ece55 100644 --- a/ngsplanner_schema.sql +++ b/ngsplanner_schema.sql @@ -25,7 +25,8 @@ CREATE TABLE "food" ( "weak_point_dmg" boolean, "hp_recovery" boolean, "popularity" int, - "editors_choice" int + "editors_choice" int, + "rarity" int ); CREATE TABLE "class" ( @@ -163,7 +164,8 @@ CREATE TABLE "augment" ( "pb_gauge_build" float, "popularity" int, "editors_choice" int, - "element_id" int + "element_id" int, + "icon" text ); CREATE TABLE "skill" ( @@ -209,8 +211,7 @@ CREATE TABLE "weapon_existence_data" ( CREATE TABLE "augment_type" ( "id" SERIAL UNIQUE PRIMARY KEY, - "name" text, - "icon" text + "name" text ); CREATE TABLE "photon_art" ( diff --git a/ngsplanner_seed.sql b/ngsplanner_seed.sql index 3c79777..c7c863e 100644 --- a/ngsplanner_seed.sql +++ b/ngsplanner_seed.sql @@ -30,10 +30,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) values(1,1.05,10,1.05,1.05,1,1,1,1); -insert into food(name,description,icon,potency,pp,dmg_res,hp,pp_consumption,pp_recovery,weak_point_dmg,hp_recovery,popularity,editors_choice) - values('Rich Aelio Meat','Meat','',true,false,false,false,true,false,false,false,0,0); -insert into food(name,description,icon,potency,pp,dmg_res,hp,pp_consumption,pp_recovery,weak_point_dmg,hp_recovery,popularity,editors_choice) - values('Light Aelio Meat','Meat','',true,false,false,false,false,true,false,false,0,0); +insert into food(name,description,icon,potency,pp,dmg_res,hp,pp_consumption,pp_recovery,weak_point_dmg,hp_recovery,popularity,editors_choice,rarity) + values('Rich Aelio Meat','Meat','',true,false,false,false,true,false,false,false,0,0,1); +insert into food(name,description,icon,potency,pp,dmg_res,hp,pp_consumption,pp_recovery,weak_point_dmg,hp_recovery,popularity,editors_choice,rarity) + values('Light Aelio Meat','Meat','',true,false,false,false,false,true,false,false,0,0,2); insert into class(name,icon) values('Hunter','/icons/UINGSClassHu.png'); insert into class(name,icon) values('Fighter','/icons/UINGSClassFi.png'); diff --git a/server.js b/server.js index b049ef0..3055adc 100644 --- a/server.js +++ b/server.js @@ -199,7 +199,7 @@ const ENDPOINTDATA=[ }, { endpoint:"food", - requiredfields:["name"], + requiredfields:["name","rarity"], 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. },