You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2009103100.sql 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. -- Updates from version 0.3.1
  2. -- ALTER TABLE identities ADD COLUMN changed datetime NOT NULL default '0000-00-00 00:00:00'; --
  3. CREATE TABLE temp_identities (
  4. identity_id integer NOT NULL PRIMARY KEY,
  5. user_id integer NOT NULL default '0',
  6. standard tinyint NOT NULL default '0',
  7. name varchar(128) NOT NULL default '',
  8. organization varchar(128) default '',
  9. email varchar(128) NOT NULL default '',
  10. "reply-to" varchar(128) NOT NULL default '',
  11. bcc varchar(128) NOT NULL default '',
  12. signature text NOT NULL default '',
  13. html_signature tinyint NOT NULL default '0'
  14. );
  15. INSERT INTO temp_identities (identity_id, user_id, standard, name, organization, email, "reply-to", bcc, signature, html_signature)
  16. SELECT identity_id, user_id, standard, name, organization, email, "reply-to", bcc, signature, html_signature
  17. FROM identities WHERE del=0;
  18. DROP INDEX ix_identities_user_id;
  19. DROP TABLE identities;
  20. CREATE TABLE identities (
  21. identity_id integer NOT NULL PRIMARY KEY,
  22. user_id integer NOT NULL default '0',
  23. changed datetime NOT NULL default '0000-00-00 00:00:00',
  24. del tinyint NOT NULL default '0',
  25. standard tinyint NOT NULL default '0',
  26. name varchar(128) NOT NULL default '',
  27. organization varchar(128) default '',
  28. email varchar(128) NOT NULL default '',
  29. "reply-to" varchar(128) NOT NULL default '',
  30. bcc varchar(128) NOT NULL default '',
  31. signature text NOT NULL default '',
  32. html_signature tinyint NOT NULL default '0'
  33. );
  34. CREATE INDEX ix_identities_user_id ON identities(user_id, del);
  35. INSERT INTO identities (identity_id, user_id, standard, name, organization, email, "reply-to", bcc, signature, html_signature)
  36. SELECT identity_id, user_id, standard, name, organization, email, "reply-to", bcc, signature, html_signature
  37. FROM temp_identities;
  38. DROP TABLE temp_identities;
  39. CREATE TABLE contactgroups (
  40. contactgroup_id integer NOT NULL PRIMARY KEY,
  41. user_id integer NOT NULL default '0',
  42. changed datetime NOT NULL default '0000-00-00 00:00:00',
  43. del tinyint NOT NULL default '0',
  44. name varchar(128) NOT NULL default ''
  45. );
  46. CREATE INDEX ix_contactgroups_user_id ON contactgroups(user_id, del);
  47. CREATE TABLE contactgroupmembers (
  48. contactgroup_id integer NOT NULL,
  49. contact_id integer NOT NULL default '0',
  50. created datetime NOT NULL default '0000-00-00 00:00:00',
  51. PRIMARY KEY (contactgroup_id, contact_id)
  52. );