summaryrefslogtreecommitdiff
path: root/webmail/plugins/google_contacts/SQL/postgres.initial.sql
blob: d8dee00ca7265bb063d4f5156441a673b4f0e86d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--
-- Sequence "collected_contact_ids"
-- Name: collected_contact_ids; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE collected_contact_ids
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;

--
-- Table "google_contacts"
-- Name: google_contacts; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE google_contacts (
    contact_id integer DEFAULT nextval('collected_contact_ids'::text) PRIMARY KEY,
    user_id integer NOT NULL REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
    changed timestamp with time zone DEFAULT now() NOT NULL,
    del smallint DEFAULT 0 NOT NULL,
    name character varying(128) DEFAULT ''::character varying NOT NULL,
    email character varying(128) DEFAULT ''::character varying NOT NULL,
    firstname character varying(128) DEFAULT ''::character varying NOT NULL,
    surname character varying(128) DEFAULT ''::character varying NOT NULL,
    vcard text
);

CREATE INDEX google_contacts_user_id_idx ON google_contacts (user_id);