[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 1.4 TABLE audittrail field person_id references person(entity_id)
- Subject: Re: 1.4 TABLE audittrail field person_id references person(entity_id)
- From: Rob Ransbottom <..hidden..>
- Date: Mon, 22 Dec 2014 16:25:51 -0500
> > Should field person_id in audittrail not reference
> > person(id)
> > instead of
> > person(entity_id)
> >
> > If different persons of same entity change things, you only see
> > entity.id , not person.id.
> > You cannot tell which person changed things.
> Yup. That's probably a bug indeed. Feel free to go ahead and change it.
Okay, I am officially confused. What is the business logic underneath
this?
By my reading of 1.4.9 table person and table entity, there can be only
one person per entity:
CREATE TABLE entity (
id serial UNIQUE,
-- elided
PRIMARY KEY(control_code, entity_class));
CREATE TABLE person (
id serial PRIMARY KEY,
entity_id integer references entity(id) not null,
-- elided
unique(entity_id) -- needed due to entity_employee assumptions --CT
);
I was under the impression that an entity represented a "party", that is
something/someone that _may_ be a party to a contract. This implies a
one-to-one constraint between a person and her entity (ie: self).
Looking around for more clarity, I find:
CREATE TABLE company (
id serial UNIQUE,
entity_id integer not null references entity(id),
legal_name text check (legal_name ~ '[[:alnum:]_]'),
tax_id text,
sales_tax_id text,
license_number text,
sic_code varchar,
created date default current_date not null,
PRIMARY KEY (entity_id,legal_name)
);
Which seems to allow many misspelled companies to link to the same entity.
Is that what is intended?
rir
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
Ledger-smb-devel mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel