all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Designing people and organization management for Emacs
@ 2020-12-03 20:15 Jean Louis
  2020-12-04  9:56 ` Eric S Fraga
  0 siblings, 1 reply; 18+ messages in thread
From: Jean Louis @ 2020-12-03 20:15 UTC (permalink / raw)
  To: Help GNU Emacs

I have this already since years and I am using it efficiently. There
is nothing much I ever think about the underlying database.

Purpose of this is to design package with contacts management for
Emacs. Many functions I already have. I am quickly sending emails,
SMS, quickly locating contacts, interacting with them and
similar. There are many tables in the database and contacts is one of
most important one.

Today I would not call it any more "contacts", I would rather like to
call it people. As contact is also organization or company as entity
in itself.

I would change or rename many of columns to be more meaningful.

- some people have too many emails that may not fit into 3 fields or 6
  fields here, maybe I should work with the array of emails

- same for the phone, some have more than 3 phone numbers

It would be best if it all fits in one database table. Not that one
has to enter phones somewhere else and reference it from people's
table. I like to make one package for Emacs that handles people and
groups.

Comments are welcome.

I am especially looking into insights:

- what other entries may be required for people's table?

- how to rename or name columns more meaningful and international? I
  was idiosyncratic in naming columns

- anything what is wrong with the table?

All opinions are appreciated.

Table "public.contacts"
           Column           |            Type             | Collation | Nullable |                    Default                    | Storage  | Stats target |     Description      
----------------------------+-----------------------------+-----------+----------+-----------------------------------------------+----------+--------------+----------------------
 contacts_id                | integer                     |           | not null | nextval('contacts_contacts_id_seq'::regclass) | plain    |              | ID
 contacts_datecreated       | timestamp without time zone |           |          | now()                                         | plain    |              | Date created
 contacts_datemodified      | timestamp without time zone |           |          |                                               | plain    |              | Date modified
 contacts_timestamp         | timestamp with time zone    |           |          | now()                                         | plain    |              | Timestamp
 contacts_prefix            | integer                     |           |          |                                               | plain    |              | Prefix
 contacts_firstname         | text                        |           |          |                                               | extended |              | First name
 contacts_additionalnames   | text                        |           |          |                                               | extended |              | Middle names
 contacts_lastname          | text                        |           | not null |                                               | extended |              | Last name
 contacts_suffix            | integer                     |           |          |                                               | plain    |              | Suffix
 contacts_namesformat       | integer                     |           |          | 2                                             | plain    |              | Name's format
 contacts_account1          | integer                     |           |          |                                               | plain    |              | Account
 contacts_account2          | integer                     |           |          |                                               | plain    |              | Company
 contacts_account3          | integer                     |           |          |                                               | plain    |              | Member of
 contacts_leadsource        | integer                     |           |          | 12                                            | plain    |              | Lead source
 contacts_title             | text                        |           |          |                                               | extended |              | Title
 contacts_department        | text                        |           |          |                                               | extended |              | Department
 contacts_birthdate         | date                        |           |          |                                               | plain    |              | Birthdate
 contacts_reportsto         | integer                     |           |          |                                               | plain    |              | Reports to
 contacts_donotcall         | boolean                     |           |          |                                               | plain    |              | Do not call
 contacts_invalid1          | boolean                     |           |          |                                               | plain    |              | Invalid e-mail (1)
 contacts_invalid2          | boolean                     |           |          |                                               | plain    |              | Invalid e-mail (2)
 contacts_invalid3          | boolean                     |           |          |                                               | plain    |              | Invalid e-mail (3)
 contacts_officephone       | text                        |           |          |                                               | extended |              | Office phone
 contacts_mobilephone       | text                        |           |          |                                               | extended |              | Mobile phone
 contacts_homephone         | text                        |           |          |                                               | extended |              | Home phone
 contacts_otherphone        | text                        |           |          |                                               | extended |              | Other phone
 contacts_fax               | text                        |           |          |                                               | extended |              | Fax
 contacts_email1            | text                        |           |          |                                               | extended |              | E-mail (1)
 contacts_email2            | text                        |           |          |                                               | extended |              | E-mail (2)
 contacts_email3            | text                        |           |          |                                               | extended |              | E-mail (3)
 contacts_website           | text                        |           |          |                                               | extended |              | Website
 contacts_blogfeed          | text                        |           |          |                                               | extended |              | Blog feed
 contacts_im1               | text                        |           |          |                                               | extended |              | IM Nick
 contacts_im1type           | integer                     |           |          |                                               | plain    |              | IM Type
 contacts_im2               | text                        |           |          |                                               | extended |              | IM Nick
 contacts_im2type           | integer                     |           |          |                                               | plain    |              | IM (2) Type
 contacts_im3               | text                        |           |          |                                               | extended |              | IM Nick
 contacts_im3type           | integer                     |           |          |                                               | plain    |              | IM (3) Type
 contacts_primaryaddress    | text                        |           |          |                                               | extended |              | Primary address
 contacts_primarycity       | text                        |           |          |                                               | extended |              | Primary city
 contacts_primarypostalcode | text                        |           |          |                                               | extended |              | Primary postal code
 contacts_primarystate      | text                        |           |          |                                               | extended |              | Primary state
 contacts_primarycountry    | integer                     |           |          |                                               | plain    |              | Primary country
 contacts_otheraddress      | text                        |           |          |                                               | extended |              | Other address
 contacts_othercity         | text                        |           |          |                                               | extended |              | Other city
 contacts_otherpostalcode   | text                        |           |          |                                               | extended |              | Other postal code
 contacts_otherstate        | text                        |           |          |                                               | extended |              | Other state
 contacts_othercountry      | integer                     |           |          |                                               | plain    |              | Other country
 contacts_description       | text                        |           |          |                                               | extended |              | Description
 contacts_modifiedusername  | text                        |           | not null | "current_user"()                              | extended |              | Modified by username
 contacts_createdusername   | text                        |           | not null | "current_user"()                              | extended |              | Created by username
 contacts_introducedby      | integer                     |           |          | 1                                             | plain    |              | Introduced by
Indexes:
    "contacts_pkey" PRIMARY KEY, btree (contacts_id)
    "contacts_email_index" btree (contacts_email1, contacts_email2, contacts_email3)
    "contacts_faster_idx" btree (contacts_id, contacts_firstname, contacts_lastname, contacts_email1, contacts_email2, contacts_email3, contacts_account1, contacts_account2, contacts_account3, contacts_primarycountry)
Check constraints:
    "contacts_additionalnames_check" CHECK (contacts_additionalnames !~ '
'::text)
    "contacts_contacts_lastname_check" CHECK (length(contacts_lastname) > 0)
    "contacts_email1_check" CHECK (contacts_email1 !~ '
'::text)
    "contacts_email2_check" CHECK (contacts_email2 !~ '
'::text)
    "contacts_email3_check" CHECK (contacts_email3 !~ '
'::text)
    "contacts_firstname_check" CHECK (contacts_firstname !~ '
'::text)
    "contacts_lastname_check" CHECK (contacts_lastname !~ '
'::text)
Foreign-key constraints:
    "contacts_contacts_account1_fkey" FOREIGN KEY (contacts_account1) REFERENCES accounts(accounts_id)
    "contacts_contacts_account2_fkey" FOREIGN KEY (contacts_account2) REFERENCES accounts(accounts_id)
    "contacts_contacts_account3_fkey" FOREIGN KEY (contacts_account3) REFERENCES accounts(accounts_id)
    "contacts_contacts_im1type_fkey" FOREIGN KEY (contacts_im1type) REFERENCES messengers(messengers_id)
    "contacts_contacts_im2type_fkey" FOREIGN KEY (contacts_im2type) REFERENCES messengers(messengers_id)
    "contacts_contacts_im3type_fkey" FOREIGN KEY (contacts_im3type) REFERENCES messengers(messengers_id)
    "contacts_contacts_introducedby_fkey" FOREIGN KEY (contacts_introducedby) REFERENCES contacts(contacts_id)
    "contacts_contacts_leadsource_fkey" FOREIGN KEY (contacts_leadsource) REFERENCES leadsources(leadsources_id)
    "contacts_contacts_namesformat_fkey" FOREIGN KEY (contacts_namesformat) REFERENCES namesformat(namesformat_id)
    "contacts_contacts_othercountry_fkey" FOREIGN KEY (contacts_othercountry) REFERENCES countries(countries_id)
    "contacts_contacts_prefix_fkey" FOREIGN KEY (contacts_prefix) REFERENCES prefixes(prefixes_id)
    "contacts_contacts_primarycountry_fkey" FOREIGN KEY (contacts_primarycountry) REFERENCES countries(countries_id)
    "contacts_contacts_reportsto_fkey" FOREIGN KEY (contacts_reportsto) REFERENCES contacts(contacts_id)
    "contacts_contacts_suffix_fkey" FOREIGN KEY (contacts_suffix) REFERENCES suffixes(suffixes_id)



^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2020-12-06 15:41 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-03 20:15 Designing people and organization management for Emacs Jean Louis
2020-12-04  9:56 ` Eric S Fraga
2020-12-04 13:12   ` Pankaj Jangid
2020-12-04 13:38   ` Jean Louis
2020-12-04 14:52     ` Christopher Dimech
2020-12-04 15:21       ` Jean Louis
2020-12-04 16:09         ` Christopher Dimech
2020-12-04 16:20           ` Eric S Fraga
2020-12-05  3:14             ` Pankaj Jangid
2020-12-06 15:41               ` Eric S Fraga
2020-12-04 16:26           ` Jean Louis
2020-12-04 16:42             ` Christopher Dimech
2020-12-04 17:56               ` Jean Louis
2020-12-04 18:05                 ` Christopher Dimech
2020-12-04 18:23                   ` Jean Louis
2020-12-04 19:43                     ` Christopher Dimech
2020-12-04 21:21                       ` Jean Louis
2020-12-05  6:11                       ` Jean Louis

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.