From f95022dd8bcceb58248fced0ccb1707c550d02ec Mon Sep 17 00:00:00 2001 From: "sigonasr2, Sig, Sigo" Date: Thu, 12 Aug 2021 01:13:19 +0000 Subject: [PATCH] Add recovery_hash field to users table. --- ngsplanner_patch.sql | 3 ++- ngsplanner_schema.sql | 3 ++- ngsplanner_seed.sql | 8 ++++---- server.js | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ngsplanner_patch.sql b/ngsplanner_patch.sql index fa0b4c5..70fcfd8 100644 --- a/ngsplanner_patch.sql +++ b/ngsplanner_patch.sql @@ -5,4 +5,5 @@ alter table weapon_type add column shorthand text; alter table weapon_existence_data add column special_name text; alter table potential drop column description; alter table potential_data add column description text; -alter table photon_art add column icon text; \ No newline at end of file +alter table photon_art add column icon text; +alter table users add column recovery_hash text; \ No newline at end of file diff --git a/ngsplanner_schema.sql b/ngsplanner_schema.sql index db57cb6..059e5d9 100644 --- a/ngsplanner_schema.sql +++ b/ngsplanner_schema.sql @@ -214,7 +214,8 @@ CREATE TABLE "users" ( "created_on" timestamptz, "roles_id" int, "avatar" text, - "editors_choice" int + "editors_choice" int, + "recovery_hash" text ); CREATE TABLE "roles" ( diff --git a/ngsplanner_seed.sql b/ngsplanner_seed.sql index 0cede6e..6b37ab4 100644 --- a/ngsplanner_seed.sql +++ b/ngsplanner_seed.sql @@ -158,10 +158,10 @@ insert into roles(name) insert into roles(name) values('Guest'); -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' limit 1),''); -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' limit 1),''); +insert into users(username,email,password_hash,created_on,roles_id,avatar,recovery_hash) + values('sigonasr2','sigonasr2@gmail.com','ABCDEFG','2021-07-13 04:30+00',(select id from roles where name='Administrator' limit 1),'',''); +insert into users(username,email,password_hash,created_on,roles_id,avatar,recovery_hash) + values('sigonasr3','sigonasr3@gmail.com','ABCDEF','2021-07-14 05:30+00',(select id from roles where name='Editor' limit 1),'',''); 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' limit 1),'sigonasr2','Test Build',(select id from class where name='Ranger' limit 1),(select id from class where name='Force' limit 1),'2021-07-13 04:30+00','2021-07-13 04:30+00',5,'',0); diff --git a/server.js b/server.js index 56870bb..d698ae7 100644 --- a/server.js +++ b/server.js @@ -210,7 +210,7 @@ const ENDPOINTDATA=[ { endpoint:"users", requiredfields:["username","email","created_on","roles_id"], - optionalfields:["avatar","editors_choice"], + optionalfields:["avatar","editors_choice","recovery_hash"], excludedfields:["password_hash"] //Fields to not output in GET. }, {