diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-09-23 14:53:01 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-09-23 14:53:01 +0000 |
commit | 6294810c01be76e7aacdb113def2e97f24c15aa7 (patch) | |
tree | 45f5930c9ee721325b78d72a72334cbd74780fd0 /engine | |
parent | 0a017d37174296abd5a1a34284eaf9313b32ecf4 (diff) | |
download | elgg-6294810c01be76e7aacdb113def2e97f24c15aa7.tar.gz elgg-6294810c01be76e7aacdb113def2e97f24c15aa7.tar.bz2 |
Database upgrade script from 1.0 to latest schema.
git-svn-id: https://code.elgg.org/elgg/trunk@2104 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r-- | engine/schema/upgrades/2008092301.sql | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/engine/schema/upgrades/2008092301.sql b/engine/schema/upgrades/2008092301.sql new file mode 100644 index 000000000..d6f1a950a --- /dev/null +++ b/engine/schema/upgrades/2008092301.sql @@ -0,0 +1,67 @@ +--- Ensure default character set is UTF8
+
+ALTER TABLE `prefix_config` DEFAULT CHARACTER SET utf8;
+ALTER TABLE `prefix_entities` DEFAULT CHARACTER SET utf8;
+ALTER TABLE `prefix_entity_subtypes` DEFAULT CHARACTER SET utf8;
+ALTER TABLE `prefix_entity_relationships` DEFAULT CHARACTER SET utf8;
+ALTER TABLE `prefix_access_collections` DEFAULT CHARACTER SET utf8;
+ALTER TABLE `prefix_access_collection_membership` DEFAULT CHARACTER SET utf8;
+ALTER TABLE `prefix_objects_entity` DEFAULT CHARACTER SET utf8;
+ALTER TABLE `prefix_sites_entity` DEFAULT CHARACTER SET utf8;
+ALTER TABLE `prefix_users_entity` DEFAULT CHARACTER SET utf8;
+ALTER TABLE `prefix_groups_entity` DEFAULT CHARACTER SET utf8;
+ALTER TABLE `prefix_annotations` DEFAULT CHARACTER SET utf8;
+ALTER TABLE `prefix_metadata` DEFAULT CHARACTER SET utf8;
+ALTER TABLE `prefix_metastrings` DEFAULT CHARACTER SET utf8;
+ALTER TABLE `prefix_api_users` DEFAULT CHARACTER SET utf8;
+ALTER TABLE `prefix_users_apisessions` DEFAULT CHARACTER SET utf8;
+ALTER TABLE `prefix_datalists` DEFAULT CHARACTER SET utf8;
+ALTER TABLE `prefix_system_log` DEFAULT CHARACTER SET utf8;
+
+-- New keys
+
+ALTER TABLE `prefix_entities` ADD KEY `type` (`type`);
+ALTER TABLE `prefix_entities` ADD KEY `subtype` (`subtype`);
+ALTER TABLE `prefix_entities` ADD KEY `owner_guid` (`owner_guid`);
+ALTER TABLE `prefix_entities` ADD KEY `container_guid` (`container_guid`);
+ALTER TABLE `prefix_entities` ADD KEY `access_id` (`access_id`);
+ALTER TABLE `prefix_entities` ADD KEY `time_created` (`time_created`);
+ALTER TABLE `prefix_entities` ADD KEY `time_updated` (`time_updated`);
+
+ALTER TABLE `prefix_users_entity` ADD KEY `email` (`email`(50));
+ALTER TABLE `prefix_users_entity` ADD KEY `code` (`code`(50));
+
+ALTER TABLE `prefix_annotations` ADD KEY `entity_guid` (`entity_guid`);
+ALTER TABLE `prefix_annotations` ADD KEY `name_id` (`name_id`);
+ALTER TABLE `prefix_annotations` ADD KEY `value_id` (`value_id`);
+ALTER TABLE `prefix_annotations` ADD KEY `owner_guid` (`owner_guid`);
+ALTER TABLE `prefix_annotations` ADD KEY `access_id` (`access_id`);
+
+ALTER TABLE `prefix_metadata` ADD KEY `entity_guid` (`entity_guid`);
+ALTER TABLE `prefix_metadata` ADD KEY `name_id` (`name_id`);
+ALTER TABLE `prefix_metadata` ADD KEY `value_id` (`value_id`);
+ALTER TABLE `prefix_metadata` ADD KEY `owner_guid` (`owner_guid`);
+ALTER TABLE `prefix_metadata` ADD KEY `access_id` (`access_id`);
+
+ALTER TABLE `prefix_metastrings` DROP KEY `string`;
+ALTER TABLE `prefix_metastrings` ADD KEY `string` (`string`(50));
+
+ALTER TABLE `prefix_users_apisessions` ADD KEY `token` (`token`);
+
+ALTER TABLE `prefix_system_log` ADD KEY `object_id` (`object_id`);
+ALTER TABLE `prefix_system_log` ADD KEY `object_class` (`object_class`);
+ALTER TABLE `prefix_system_log` ADD KEY `event` (`event`);
+ALTER TABLE `prefix_system_log` ADD KEY `performed_by_guid` (`performed_by_guid`);
+ALTER TABLE `prefix_system_log` ADD KEY `time_created` (`time_created`);
+
+DROP TABLE `prefix_privileged_paths`;
+
+-- HMAC Cache protecting against Replay attacks
+
+CREATE TABLE IF NOT EXISTS `prefix_hmac_cache` (
+ `hmac` varchar(255) NOT NULL,
+ `ts` int(11) NOT NULL,
+
+ PRIMARY KEY (`hmac`),
+ KEY `ts` (`ts`)
+) ENGINE=MEMORY;
\ No newline at end of file |