design patterns - How to properly extend a database model with PHP -
i know title of question not intuitive, let's go question.
i've designed "core system" backend web apps (control panels, systems manage clientes, balances, etc). "core" start point developing new modules according new system specific needs, keep "core modules":
- users (to manage user roles)
- user type (in distinct systems there distinct kinds of users, it's nice manage them dinamicly)
- modules (to create new modules , add permissions them)
- dashboard
my main question user module. since has default columns
- userid; name; login; e-mail; password; isroot; ispoweruser; usertypeid
i want create new control panels , apps, dont want change table keep "core" updatable easy process in future. ideia of design create table named user_extra contai columns specific user.
is approach? i'll create new class named userextra.class.php.
if u want take @ project ideia: https://bitbucket.org/alexandrekop/akop-core
imagine looking @ database schema, , seeing table named "user_extra" bunch of fields aren't related each other in way , each field related different module, feel 'right'?
my suggestion split fields relevant tables, possibly per module, or per logical group.
for example, if 1 module related addresses, have table "user_addresses", things specific address of user.
Comments
Post a Comment