Skip to content

Instantly share code, notes, and snippets.

@zain
Created March 19, 2013 21:34
Show Gist options
  • Select an option

  • Save zain/5200355 to your computer and use it in GitHub Desktop.

Select an option

Save zain/5200355 to your computer and use it in GitHub Desktop.
omgmail=# \d mail_email
Table "public.mail_email"
Column | Type | Modifiers
---------------------+--------------------------+-----------
id | uuid | not null
account_id | integer | not null
last_update | timestamp with time zone | not null
uid | bigint |
gm_msg_id | bigint | not null
thread_id | bigint | not null
subject | text | not null
preview | text | not null
body | text | not null
sender | text | not null
_reply_to | text[] |
to | text[] |
cc | text[] |
bcc | text[] |
date | timestamp with time zone |
labels | text[] |
priority | integer | not null
has_attachments | boolean | not null
read | boolean | not null
traceback_if_broken | text | not null
body_content_type | character varying(254) | not null
is_inbox | boolean | not null
is_trash | boolean | not null
is_important | boolean | not null
is_starred | boolean | not null
parts | text[] |
has_inline | boolean | not null
is_draft | boolean | not null
is_sent | boolean | not null
is_spam | boolean | not null
Indexes:
"mail_email_pkey" PRIMARY KEY, btree (id)
"mail_email_account_id_da62a5e04ba59f6_uniq" UNIQUE CONSTRAINT, btree (account_id, gm_msg_id)
"mail_email_account_id" btree (account_id)
"mail_email_gm_msg_id" btree (gm_msg_id)
"mail_email_is_inbox" btree (is_inbox)
"mail_email_last_update" btree (last_update)
"thread_id_idx" btree (thread_id)
Check constraints:
"positive_uids_only" CHECK (uid > 0)
Foreign-key constraints:
"account_id_refs_id_75a704f22ad94486" FOREIGN KEY (account_id) REFERENCES mail_account(id) DEFERRABLE INITIALLY DEFERRED
Triggers:
update_label_flags BEFORE INSERT OR UPDATE ON mail_email FOR EACH ROW EXECUTE PROCEDURE update_boolean_flags_based_on_labels()
update_mail_email_last_update_time BEFORE INSERT OR UPDATE ON mail_email FOR EACH ROW EXECUTE PROCEDURE update_last_update_column()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment