Skip to content

Commit

Permalink
Merge pull request #10910 from mrclay/10389_pw_salt
Browse files Browse the repository at this point in the history
chore(schema): removes legacy salt/password columns
  • Loading branch information
mrclay committed Apr 13, 2017
2 parents f48f6d5 + 0257070 commit 617ebad
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
2 changes: 2 additions & 0 deletions docs/guides/upgrading.rst
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ Metastrings in the database have been denormalized for performance purposes. We
metadata and annotation tables. You need to update your custom queries to reflect these changes. Also the ``msv`` and ``msn`` table aliases are no longer available.
It is best practice not to rely on the table aliases used in core queries. If you need to use custom clauses you should do your own joins.

From the "users_entity" table, the ``password`` and ``hash`` columns have been removed.

Multi Site Changes
------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* Elgg 3.0.0 upgrade 2017041200
*
* Removes old password/hash columns
*/

$db = elgg()->getDb();

$db->updateData("
ALTER TABLE {$db->prefix}users_entity
DROP KEY `password`,
DROP COLUMN `password`,
DROP COLUMN `salt`
");
3 changes: 0 additions & 3 deletions engine/schema/mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,6 @@ CREATE TABLE `prefix_users_entity` (
`guid` bigint(20) unsigned NOT NULL,
`name` text NOT NULL,
`username` varchar(128) NOT NULL DEFAULT '',
`password` varchar(32) NOT NULL DEFAULT '' COMMENT 'Legacy password hashes',
`salt` varchar(8) NOT NULL DEFAULT '' COMMENT 'Legacy password salts',
-- 255 chars is recommended by PHP.net to hold future hash formats
`password_hash` varchar(255) NOT NULL DEFAULT '',
`email` text NOT NULL,
Expand All @@ -269,7 +267,6 @@ CREATE TABLE `prefix_users_entity` (
`prev_last_login` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`guid`),
UNIQUE KEY `username` (`username`),
KEY `password` (`password`),
KEY `email` (`email`(50)),
KEY `last_action` (`last_action`),
KEY `last_login` (`last_login`),
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

// YYYYMMDD = Elgg Date
// XX = Interim incrementer
$version = 2016110900;
$version = 2017041200;

$composerJson = file_get_contents(dirname(__FILE__) . "/composer.json");
if ($composerJson === false) {
Expand Down

0 comments on commit 617ebad

Please sign in to comment.