private void convertUserCreationTimeToLong() throws SQLException {
    if (!isUserCreationTimeMigrated()) {
      LOG.info("Converting user creation times...");
      final String temporaryColumnName = USERS_CREATE_TIME_COLUMN + "_numeric";
      if (!dbAccessor.tableHasColumn(USERS_TABLE, temporaryColumnName)) {
        final DBAccessor.DBColumnInfo tempColumnInfo = new DBAccessor.DBColumnInfo(temporaryColumnName, Long.class);
        dbAccessor.addColumn(USERS_TABLE, tempColumnInfo);
      }

      if (dbAccessor.tableHasColumn(USERS_TABLE, USERS_CREATE_TIME_COLUMN)) {
        final Map<Integer, Timestamp> currentUserCreateTimes = fetchCurrentUserCreateTimesNotYetMigrated(temporaryColumnName);
        for (Map.Entry<Integer, Timestamp> currentUserCreateTime : currentUserCreateTimes.entrySet()) {
          dbAccessor.updateTable(USERS_TABLE, temporaryColumnName, currentUserCreateTime.getValue().getTime(),
              "WHERE " + USERS_USER_ID_COLUMN + "=" + currentUserCreateTime.getKey());
        }

        dbAccessor.dropColumn(USERS_TABLE, USERS_CREATE_TIME_COLUMN);
      }

      final DBAccessor.DBColumnInfo usersCreateTimeColumnInfo = new DBAccessor.DBColumnInfo(USERS_CREATE_TIME_COLUMN, Long.class, null, null, false);
      dbAccessor.renameColumn(USERS_TABLE, temporaryColumnName, usersCreateTimeColumnInfo);
      LOG.info("Converted user creation times");
    } else {
      LOG.info("Already converted user creation timestamps to EPOCH representation");
    }
  }
In order to save the epoch equivalent of users.create_time we need to convert data in this column as follows:
<ol>
<li>creating a temporary column where we store the numeric representation of
the timestamp
<li>populating data in the temporary column
<li>removing original column column
<li>renaming the temporary column to the original column
</ol>

@throws SQLException
          if an error occurs while executing SQL statements
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog270.java