| От | alexander krohn |
|---|---|
| Тема | Re: one-to-one schema design question and ORM |
| Дата | |
| Msg-id | 45F6B63E.9010600@e-dict.net обсуждение исходный текст |
| Ответ на | one-to-one schema design question and ORM (Rick Schumeyer <rschumeyer@ieee.org>) |
| Список | pgsql-general |
hi. Rick Schumeyer wrote: > [...] > From a business rules perspective: > Some users are not employees (like an admin user) > Some employees are not users > [...] from my view users and employees have something in common: they are persons. why don't create a person-table with the attributes the groups share, like a login-name, etc. then your users-table will have a primary-key that is also a foreign-key, referencing the id in the person-table and the employees-table does the same. when you want to get all user- and employee-accounts for one person you have to build up a join on the tables. that's a simple view, don't know what your favourite or-mapper thinks about it. i think the above table-design can be considered 'clean' from some academic point of view ;) mfg alexander
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера