2008092301.sql 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. --- Ensure default character set is UTF8
  2. ALTER TABLE `prefix_config` DEFAULT CHARACTER SET utf8;
  3. ALTER TABLE `prefix_entities` DEFAULT CHARACTER SET utf8;
  4. ALTER TABLE `prefix_entity_subtypes` DEFAULT CHARACTER SET utf8;
  5. ALTER TABLE `prefix_entity_relationships` DEFAULT CHARACTER SET utf8;
  6. ALTER TABLE `prefix_access_collections` DEFAULT CHARACTER SET utf8;
  7. ALTER TABLE `prefix_access_collection_membership` DEFAULT CHARACTER SET utf8;
  8. ALTER TABLE `prefix_objects_entity` DEFAULT CHARACTER SET utf8;
  9. ALTER TABLE `prefix_sites_entity` DEFAULT CHARACTER SET utf8;
  10. ALTER TABLE `prefix_users_entity` DEFAULT CHARACTER SET utf8;
  11. ALTER TABLE `prefix_groups_entity` DEFAULT CHARACTER SET utf8;
  12. ALTER TABLE `prefix_annotations` DEFAULT CHARACTER SET utf8;
  13. ALTER TABLE `prefix_metadata` DEFAULT CHARACTER SET utf8;
  14. ALTER TABLE `prefix_metastrings` DEFAULT CHARACTER SET utf8;
  15. ALTER TABLE `prefix_api_users` DEFAULT CHARACTER SET utf8;
  16. ALTER TABLE `prefix_users_apisessions` DEFAULT CHARACTER SET utf8;
  17. ALTER TABLE `prefix_datalists` DEFAULT CHARACTER SET utf8;
  18. ALTER TABLE `prefix_system_log` DEFAULT CHARACTER SET utf8;
  19. -- Drop keys to avoid errors (grr)
  20. ALTER TABLE `prefix_entities` DROP KEY `type`;
  21. ALTER TABLE `prefix_entities` DROP KEY `subtype`;
  22. ALTER TABLE `prefix_entities` DROP KEY `owner_guid`;
  23. ALTER TABLE `prefix_entities` DROP KEY `container_guid`;
  24. ALTER TABLE `prefix_entities` DROP KEY `access_id`;
  25. ALTER TABLE `prefix_entities` DROP KEY `time_created`;
  26. ALTER TABLE `prefix_entities` DROP KEY `time_updated`;
  27. ALTER TABLE `prefix_users_entity` DROP KEY `email`;
  28. ALTER TABLE `prefix_users_entity` DROP KEY `code`;
  29. ALTER TABLE `prefix_annotations` DROP KEY `entity_guid`;
  30. ALTER TABLE `prefix_annotations` DROP KEY `name_id`;
  31. ALTER TABLE `prefix_annotations` DROP KEY `value_id`;
  32. ALTER TABLE `prefix_annotations` DROP KEY `owner_guid`;
  33. ALTER TABLE `prefix_annotations` DROP KEY `access_id`;
  34. ALTER TABLE `prefix_metadata` DROP KEY `entity_guid`;
  35. ALTER TABLE `prefix_metadata` DROP KEY `name_id`;
  36. ALTER TABLE `prefix_metadata` DROP KEY `value_id`;
  37. ALTER TABLE `prefix_metadata` DROP KEY `owner_guid`;
  38. ALTER TABLE `prefix_metadata` DROP KEY `access_id`;
  39. ALTER TABLE `prefix_users_apisessions` DROP KEY `token`;
  40. ALTER TABLE `prefix_system_log` DROP KEY `object_id`;
  41. ALTER TABLE `prefix_system_log` DROP KEY `object_class`;
  42. ALTER TABLE `prefix_system_log` DROP KEY `event`;
  43. ALTER TABLE `prefix_system_log` DROP KEY `performed_by_guid`;
  44. ALTER TABLE `prefix_system_log` DROP KEY `time_created`;
  45. -- New keys
  46. ALTER TABLE `prefix_entities` ADD KEY `type` (`type`);
  47. ALTER TABLE `prefix_entities` ADD KEY `subtype` (`subtype`);
  48. ALTER TABLE `prefix_entities` ADD KEY `owner_guid` (`owner_guid`);
  49. ALTER TABLE `prefix_entities` ADD KEY `container_guid` (`container_guid`);
  50. ALTER TABLE `prefix_entities` ADD KEY `access_id` (`access_id`);
  51. ALTER TABLE `prefix_entities` ADD KEY `time_created` (`time_created`);
  52. ALTER TABLE `prefix_entities` ADD KEY `time_updated` (`time_updated`);
  53. ALTER TABLE `prefix_users_entity` ADD KEY `email` (`email`(50));
  54. ALTER TABLE `prefix_users_entity` ADD KEY `code` (`code`(50));
  55. ALTER TABLE `prefix_annotations` ADD KEY `entity_guid` (`entity_guid`);
  56. ALTER TABLE `prefix_annotations` ADD KEY `name_id` (`name_id`);
  57. ALTER TABLE `prefix_annotations` ADD KEY `value_id` (`value_id`);
  58. ALTER TABLE `prefix_annotations` ADD KEY `owner_guid` (`owner_guid`);
  59. ALTER TABLE `prefix_annotations` ADD KEY `access_id` (`access_id`);
  60. ALTER TABLE `prefix_metadata` ADD KEY `entity_guid` (`entity_guid`);
  61. ALTER TABLE `prefix_metadata` ADD KEY `name_id` (`name_id`);
  62. ALTER TABLE `prefix_metadata` ADD KEY `value_id` (`value_id`);
  63. ALTER TABLE `prefix_metadata` ADD KEY `owner_guid` (`owner_guid`);
  64. ALTER TABLE `prefix_metadata` ADD KEY `access_id` (`access_id`);
  65. ALTER TABLE `prefix_metastrings` DROP KEY `string`;
  66. ALTER TABLE `prefix_metastrings` ADD KEY `string` (`string`(50));
  67. ALTER TABLE `prefix_users_apisessions` ADD KEY `token` (`token`);
  68. ALTER TABLE `prefix_system_log` ADD KEY `object_id` (`object_id`);
  69. ALTER TABLE `prefix_system_log` ADD KEY `object_class` (`object_class`);
  70. ALTER TABLE `prefix_system_log` ADD KEY `event` (`event`);
  71. ALTER TABLE `prefix_system_log` ADD KEY `performed_by_guid` (`performed_by_guid`);
  72. ALTER TABLE `prefix_system_log` ADD KEY `time_created` (`time_created`);
  73. DROP TABLE `prefix_privileged_paths`;
  74. -- HMAC Cache protecting against Replay attacks
  75. CREATE TABLE IF NOT EXISTS `prefix_hmac_cache` (
  76. `hmac` varchar(255) NOT NULL,
  77. `ts` int(11) NOT NULL,
  78. PRIMARY KEY (`hmac`),
  79. KEY `ts` (`ts`)
  80. ) ENGINE=MEMORY;