Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

2009103100.sql 1.1KB

1234567891011121314151617181920212223242526272829303132
  1. -- Updates from version 0.3.1
  2. DROP INDEX identities_user_id_idx;
  3. CREATE INDEX identities_user_id_idx ON identities (user_id, del);
  4. ALTER TABLE identities ADD changed timestamp with time zone DEFAULT now() NOT NULL;
  5. CREATE SEQUENCE contactgroups_ids
  6. INCREMENT BY 1
  7. NO MAXVALUE
  8. NO MINVALUE
  9. CACHE 1;
  10. CREATE TABLE contactgroups (
  11. contactgroup_id integer DEFAULT nextval('contactgroups_ids'::text) PRIMARY KEY,
  12. user_id integer NOT NULL
  13. REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE,
  14. changed timestamp with time zone DEFAULT now() NOT NULL,
  15. del smallint NOT NULL DEFAULT 0,
  16. name varchar(128) NOT NULL DEFAULT ''
  17. );
  18. CREATE INDEX contactgroups_user_id_idx ON contactgroups (user_id, del);
  19. CREATE TABLE contactgroupmembers (
  20. contactgroup_id integer NOT NULL
  21. REFERENCES contactgroups(contactgroup_id) ON DELETE CASCADE ON UPDATE CASCADE,
  22. contact_id integer NOT NULL
  23. REFERENCES contacts(contact_id) ON DELETE CASCADE ON UPDATE CASCADE,
  24. created timestamp with time zone DEFAULT now() NOT NULL,
  25. PRIMARY KEY (contactgroup_id, contact_id)
  26. );