private void updateUsersTable() throws SQLException {
    // Remove orphaned user records...
    dbAccessor.executeUpdate("delete from " + USERS_TABLE +
      " where " + USERS_USER_ID_COLUMN + " not in (select " + USER_AUTHENTICATION_USER_ID_COLUMN + " from " + USER_AUTHENTICATION_TABLE + ")");

    // Update the users table
    dbAccessor.dropUniqueConstraint(USERS_TABLE, UNIQUE_USERS_0_INDEX);
    dbAccessor.dropColumn(USERS_TABLE, USERS_USER_TYPE_COLUMN);
    dbAccessor.dropColumn(USERS_TABLE, USERS_LDAP_USER_COLUMN);
    dbAccessor.dropColumn(USERS_TABLE, USERS_USER_PASSWORD_COLUMN);
    dbAccessor.addColumn(USERS_TABLE, new DBAccessor.DBColumnInfo(USERS_CONSECUTIVE_FAILURES_COLUMN, Integer.class, null, 0, false));
    dbAccessor.addColumn(USERS_TABLE, new DBAccessor.DBColumnInfo(USERS_DISPLAY_NAME_COLUMN, String.class, 255, null, true)); // Set to non-null later
    dbAccessor.addColumn(USERS_TABLE, new DBAccessor.DBColumnInfo(USERS_LOCAL_USERNAME_COLUMN, String.class, 255, null, true)); // Set to non-null later
    dbAccessor.addColumn(USERS_TABLE, new DBAccessor.DBColumnInfo(USERS_VERSION_COLUMN, Long.class, null, 0, false));

    // Set the display name and local username values based on the username value
    dbAccessor.executeUpdate("update " + USERS_TABLE +
      " set " + USERS_DISPLAY_NAME_COLUMN + "=" + USERS_USER_NAME_COLUMN +
      ", " + USERS_LOCAL_USERNAME_COLUMN + "= lower(" + USERS_USER_NAME_COLUMN + ")" +
      ", " + USERS_USER_NAME_COLUMN + "= lower(" + USERS_USER_NAME_COLUMN + ")");

    // Change columns to non-null
    dbAccessor.alterColumn(USERS_TABLE, new DBAccessor.DBColumnInfo(USERS_DISPLAY_NAME_COLUMN, String.class, 255, null, false));
    dbAccessor.alterColumn(USERS_TABLE, new DBAccessor.DBColumnInfo(USERS_LOCAL_USERNAME_COLUMN, String.class, 255, null, false));

    // Add a unique constraint on the user_name column
    dbAccessor.addUniqueConstraint(USERS_TABLE, UNIQUE_USERS_0_INDEX, USERS_USER_NAME_COLUMN);
  }
Update the <code>users</code> table by adjusting the relevant columns, contained data, and indicies.
<p>
This method should be executed after creating the <code>user_authentication</code> table and
adjusting the <code>members</code> and <code>adminprivilege</code> data by merging data while
combine user entries with the same username (but different type).
<p>
<ol>
<li>
Orphaned data is removed.  These will be the records where the usernamne is duplicated but
the user type is different.  Only a single record with a given username should be left.
</li>
<li>
Remove the unique record constraint so it may be added back later declaring new constraints
</li>
<li>
Obsolete columns are removed: <code>user_type</code>, <code>ldap_user</code>, <code>user_password</code>.
These columns are handled by the <codee>user_authentication</codee> table.
</li>
<li>
Add new columns: <code>consecutive_failures</code>, <code>display_name</code>,
<code>local_username</code>, <code>version</code>.
The non-null constraints are to be set after all the date is set properly.
</li>
<li>
Ensure the <code>display_name</code> and <code>local_username</code> columns have properly set data.
</li>
<li>
Add the non-null constraint back for the <code>display_name</code> and <code>local_username</code> columns.
</li>
<li>
Add a unique index on the <code>user_name</code> column
</li>
</ol>

@throws SQLException if an error occurs while executing SQL statements
@see #createUserAuthenticationTable()
@see #updateGroupMembershipRecords()
@see #updateAdminPrivilegeRecords()
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog270.java