diff options
author | lonkaars <loek@pipeframe.xyz> | 2023-04-10 20:49:31 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2023-04-10 20:49:31 +0200 |
commit | 2c41f418fbc82376e20cf2ff7ed756a17139f7ff (patch) | |
tree | 1a9a83e774b8c758d5446adb721c7cba5c461fc5 /dbinit | |
parent | 18cf64ff465efbef39ec38bb760ec35b2fe26637 (diff) |
circuits tab done
Diffstat (limited to 'dbinit')
-rw-r--r-- | dbinit/procedures.sql | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/dbinit/procedures.sql b/dbinit/procedures.sql index 776a7ca..51a6e10 100644 --- a/dbinit/procedures.sql +++ b/dbinit/procedures.sql @@ -27,7 +27,7 @@ drop procedure if exists spUpdatePersons; delimiter $$ create procedure spUpdatePersons(imgPath varchar(255)) begin - select concat(imgPath, regexp_replace(concat(`firstName`, " ", `middleName`, " ", `lastName`), ' *', ' '), ".jpg") from `member`; + -- select concat(imgPath, regexp_replace(concat(`firstName`, " ", `middleName`, " ", `lastName`), ' *', ' '), ".jpg") from `member`; update `member` as `A` set `A`.`photo` = ( select load_file(concat(imgPath, regexp_replace(concat(`firstName`, " ", `middleName`, " ", `lastName`), ' *', ' '), ".jpg")) as `photo` @@ -36,3 +36,16 @@ create procedure spUpdatePersons(imgPath varchar(255)) end$$ delimiter ; +drop procedure if exists spUpdateCircuits; + +delimiter $$ +create procedure spUpdateCircuits(imgPath varchar(255)) + begin + -- select concat(imgPath, regexp_replace(`name`, " ", "_"), ".png") from circuit; + update `circuit` as `A` + set `A`.`photo` = ( + select load_file(concat(imgPath, regexp_replace(`name`, " ", "_"), ".png")) as `photo` + from `circuit` as `B` + where `B`.`ID` = `A`.`ID`); + end$$ +delimiter ; |