Table "public.food_foods" Column | Type | Modifiers ------------------------------+------------------------+----------------------------------------------------------------- food_id | integer | not null default nextval('public.food_foods_food_id_seq'::text) category_id | integer | not null brand_id | integer | not null source_id | integer | not null description | character varying(255) | not null base | real | type | character(1) | not null default 'M' created | date | not null default ('now'::text)::date modified | date | not null default ('now'::text)::date water | real | kilojoules | real | calories | real | protein | real | total_fat | real | total_carbohydrate | real | sugars | real | starch_and_dextrins | real | fiber | real | calcium | real | phosphorus | real | iron | real | sodium | real | potassium | real | magnesium | real | zinc | real | retinol_equivalent | real | retinol | real | beta_carotene_equivalent | real | thiamin | real | riboflavin | real | niacin_equivalent | real | niacin | real | vitamin_c | real | alcohol | real | saturated_fatty_acids | real | monounsaturated_fatty_acids | real | poly_unsaturated_fatty_acids | real | omega3_fatty_acids | real | cholesterol | real | folate | real | caffeine | real | ftiidx | txtidx | in_palm | boolean | default true brand_name | character varying(255) | staff_id | integer | Indexes: food_foods_pkey primary key btree (food_id), food_foods_brand_id_idx btree (brand_id), food_foods_category_id_brand_id_idx btree (category_id, brand_id), food_foods_ftiidx_key gist (ftiidx), food_foods_modified_key btree (modified) Check constraints: "$1" ((("type" = 'M'::bpchar) OR ("type" = 'V'::bpchar)) OR ("type" = 'S'::bpchar)) Foreign Key constraints: $5 FOREIGN KEY (staff_id) REFERENCES admin_staff(staff_id) ON UPDATE NO ACTION ON DELETE SET NULL, $4 FOREIGN KEY (source_id) REFERENCES food_sources(source_id) ON UPDATE NO ACTION ON DELETE NO ACTION, $3 FOREIGN KEY (brand_id) REFERENCES food_brands(brand_id) ON UPDATE NO ACTION ON DELETE NO ACTION, $2 FOREIGN KEY (category_id) REFERENCES food_categories(category_id) ON UPDATE NO ACTION ON DELETE NO ACTION Triggers: food_foods_ftiidx_trig Table "public.users_users" Column | Type | Modifiers -----------------+--------------------------+---------------------------------------------------------- userid | integer | not null default nextval('users_users_userid_seq'::text) firstname | character varying(255) | not null lastname | character varying(255) | not null email | character varying(255) | not null username | character varying(32) | not null password | character varying(32) | not null admin | boolean | not null default 'f' promo | boolean | not null default 'f' joindate | date | not null default 'today' country | character varying(30) | not null postcode | character varying(20) | not null suspended | boolean | not null default 'f' address | character varying(255) | suburb | character varying(255) | state | character varying(255) | city | character varying(255) | sex | character(1) | not null dob | date | not null phone | character varying(30) | expiry | date | freebie | boolean | not null default 'f' listed | boolean | default 'f' last_time | timestamp with time zone | last_browser | character varying(255) | notify | boolean | default 't' referrer | integer | cc_number | text | cc_name | text | cc_type | text | cc_expire_mon | text | cc_expire_year | text | recurring | boolean | not null default 'f' meetings | boolean | default 't' publicdiary | boolean | not null default 'f' suspended_on | date | suspended_off | date | online | boolean | not null default true message | boolean | not null default true msgreceive | boolean | not null default true recurring_id | character varying(255) | cobrand_id | integer | not null first_brand | integer | not null last_brand | integer | not null professional_id | integer | publicjournal | boolean | not null default false Indexes: users_users_pkey primary key btree (userid), users_users_cobrand_id_key unique btree (cobrand_id, username), expiry_users_users_key btree (expiry), users_users_email_lower_idx btree (lower(email)), users_users_professional_id_idx btree (professional_id) WHERE (professional_id IS NOT NULL), users_users_referrer_idx btree (referrer) WHERE (referrer IS NOT NULL), users_users_susp_off_idx btree (suspended_off) WHERE (suspended_off IS NOT NULL) Check constraints: "$2" (NOT (recurring AND suspended)) "users_users_sex" ((sex = 'M'::bpchar) OR (sex = 'F'::bpchar)) Foreign Key constraints: $6 FOREIGN KEY (professional_id) REFERENCES professionals(user_id) ON UPDATE NO ACTION ON DELETE NO ACTION, $5 FOREIGN KEY (last_brand) REFERENCES cobrands(cobrand_id) ON UPDATE NO ACTION ON DELETE NO ACTION, $4 FOREIGN KEY (first_brand) REFERENCES cobrands(cobrand_id) ON UPDATE NO ACTION ON DELETE NO ACTION, $3 FOREIGN KEY (cobrand_id) REFERENCES cobrands(cobrand_id) ON UPDATE NO ACTION ON DELETE NO ACTION, $1 FOREIGN KEY (referrer) REFERENCES users_users(userid) ON UPDATE NO ACTION ON DELETE SET NULL Triggers: RI_ConstraintTrigger_973531, RI_ConstraintTrigger_973532, RI_ConstraintTrigger_973541, RI_ConstraintTrigger_973542, RI_ConstraintTrigger_973545, RI_ConstraintTrigger_973546, RI_ConstraintTrigger_973561, RI_ConstraintTrigger_973562, RI_ConstraintTrigger_973563, RI_ConstraintTrigger_973564, RI_ConstraintTrigger_973567, RI_ConstraintTrigger_973568, RI_ConstraintTrigger_973571, RI_ConstraintTrigger_973572, RI_ConstraintTrigger_973573, RI_ConstraintTrigger_973574, RI_ConstraintTrigger_973761, RI_ConstraintTrigger_973762, RI_ConstraintTrigger_973783, RI_ConstraintTrigger_973784