Hi all,
This week I started working on a new project at work. After successfully completing a different project, management decided to give me something that was a lost cause for them.
Basically, the want me to add editing feature to their customer list... through a web interface (think of it as CRUD). Problem is the data structures that the original dev used. There are two different database entries (mediumblobs in MySQL). First one contains THE WHOLE list of CUSTOMER_IDs (delineated by CR/LF) and the second one contains the list of customer names, addresses, phone numbers etc. For reasons unknown to me, consultant decided on this crazy structure. Graphically, it looks like this:
List of Customer IDs (CUST_ID)
-----------------------------
0898789
1287777
4747777
7166666
...
and the second mediumblob contains a giant list of names, addresses, phone numbers etc:
Second list - CUST_INFO
-------------------------------------
Joe Smith; 789 Avenue; 873-555-5555
Jane Smith; 87 Elm; 872-555-5555
....
Now, to find the customer ID of Jane Smith, you count the line where her name appears in CUST_INFO list (in this case 2nd) and then you find the second entry in CUST_ID list... in this case it's: 1287777
WHY THEY EVEN USE A DATABASE FOR THIS IS BEYOND ME! Obviously, this was implemented by someone who wanted to get it done as quickly as possible so what they did was to take the original list and just dump it as a single entry in the database.
Anyway, my question is following... since I cannot change the schema (it would break too many things), how should I implement editing? They want me to allow someone to open this list in a page and for example insert a new customer ID into CUST_ID list. To make this work, I would then have to go back to CUST_INFO list and modify it there as well. But how to figure out where they made an edit is beyond me...
Anyway, if anyone wants to offer some advice, please do. I hope I don't have to quit my job over this nonsense :(