![]() |
CRUD applications to update MYSQL database - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Best Practices (https://forum.codeigniter.com/forumdisplay.php?fid=12) +--- Thread: CRUD applications to update MYSQL database (/showthread.php?tid=80108) |
CRUD applications to update MYSQL database - mcrase2021 - 09-14-2021 This is a broad topic i think needs more documentation. My question relates to overcoming database constraints without compromising date, security. I have database constraints that disallow my crud from updating table rows i want updated. For instance you cant update the child rows of a database without going to the parent. I am looking for much more guidance on best practices for crud applications. Is it a good, feasible practice to then call two tables at once weaved together so the crud can update the primary target table? Is it bad practice to run crud application on such tables? Is it a good practice to use a query for the crud application goals instead? Is it wise to simply turn off all the restrictions? I can restrict the crud to a limited set of forms but i would like to reach more if not all tables, the database restrictions are a major obstacle to that. I see clearly that i can simply skip the problem column in question. I need the freedom to update that column so my administrator section can update the target item. Every crud example i have seen so far fails to reach the desired depth or goes so deep the application becomes unstable. I am ok with one crud application for each table but i would be more happy with one crud application that could handle the diversity of all tables, their specific constraints. If i am to continue with one crud application per table i want to hear back from someone who has been there before. RE: CRUD applications to update MYSQL database - InsiteFX - 09-15-2021 Constraints are put on a database to protect the data. Why should you be able to delete an invoice if it belongs to an exsiting customer and is out standing? RE: CRUD applications to update MYSQL database - ikesela - 09-15-2021 its depend how the database is designed. restructured database and remove constraint if need. make sure some table independent (required delete but need to retain parent data) RE: CRUD applications to update MYSQL database - mcrase2021 - 09-17-2021 (09-15-2021, 01:09 AM)InsiteFX Wrote: Constraints are put on a database to protect the data. RE: CRUD applications to update MYSQL database - mcrase2021 - 09-20-2021 OK so i have solved my primary indexing issues in 2 steps. 1 by simply changing my primary key selection( misinterpretation of my key at issue ), 2 by flipping the variable chosen for some of my loops, my oops on that one! Since the keys are really important to my database i backed up the table separate from my database backup before proving out the crud. I have chosen to allow changes on different columns in my model rather than all (all columns not practical) ---protected $allowedFields = [ 'a', 'b', 'c' ];. I will only list my important columns , the target columns where updating is truly needed i will try to setup soft deletes, update tracking on those fields in the adjoining html form next. |