This is an automated email from the ASF dual-hosted git repository.

amagyar pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 8bdef42  AMBARI-23204. Ambari Upgrade : Schema Upgrade Fails with 
error "Foreign key constraint is incorrectly formed" (amagyar)
8bdef42 is described below

commit 8bdef4281a818597cf75f9f8360748fef892b4b4
Author: Attila Magyar <amag...@hortonworks.com>
AuthorDate: Mon Mar 12 17:43:10 2018 +0100

    AMBARI-23204. Ambari Upgrade : Schema Upgrade Fails with error "Foreign key 
constraint is incorrectly formed" (amagyar)
---
 .../main/java/org/apache/ambari/server/upgrade/UpgradeCatalog270.java  | 3 +--
 .../java/org/apache/ambari/server/upgrade/UpgradeCatalog270Test.java   | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog270.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog270.java
index d59248d..1055e98 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog270.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog270.java
@@ -516,10 +516,9 @@ public class UpgradeCatalog270 extends 
AbstractUpgradeCatalog {
   private void createUserAuthenticationTable() throws SQLException {
     if (!usersTableUpgraded()) {
       final String temporaryTable = USER_AUTHENTICATION_TABLE + "_tmp";
-
       List<DBAccessor.DBColumnInfo> columns = new ArrayList<>();
       columns.add(new 
DBAccessor.DBColumnInfo(USER_AUTHENTICATION_USER_AUTHENTICATION_ID_COLUMN, 
Long.class, null, null, false));
-      columns.add(new 
DBAccessor.DBColumnInfo(USER_AUTHENTICATION_USER_ID_COLUMN, Long.class, null, 
null, false));
+      columns.add(new 
DBAccessor.DBColumnInfo(USER_AUTHENTICATION_USER_ID_COLUMN, Integer.class, 
null, null, false));
       columns.add(new 
DBAccessor.DBColumnInfo(USER_AUTHENTICATION_AUTHENTICATION_TYPE_COLUMN, 
String.class, 50, null, false));
       columns.add(new 
DBAccessor.DBColumnInfo(USER_AUTHENTICATION_AUTHENTICATION_KEY_COLUMN, 
Clob.class, null, null, true));
       columns.add(new 
DBAccessor.DBColumnInfo(USER_AUTHENTICATION_CREATE_TIME_COLUMN, 
Timestamp.class, null, null, true));
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog270Test.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog270Test.java
index 3d1385d..1f2428a 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog270Test.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog270Test.java
@@ -616,7 +616,7 @@ public class UpgradeCatalog270Test {
       validateColumns(capturedValue,
           Arrays.asList(
               new 
DBAccessor.DBColumnInfo(USER_AUTHENTICATION_USER_AUTHENTICATION_ID_COLUMN, 
Long.class, null, null, false),
-              new DBAccessor.DBColumnInfo(USER_AUTHENTICATION_USER_ID_COLUMN, 
Long.class, null, null, false),
+              new DBAccessor.DBColumnInfo(USER_AUTHENTICATION_USER_ID_COLUMN, 
Integer.class, null, null, false),
               new 
DBAccessor.DBColumnInfo(USER_AUTHENTICATION_AUTHENTICATION_TYPE_COLUMN, 
String.class, 50, null, false),
               new 
DBAccessor.DBColumnInfo(USER_AUTHENTICATION_AUTHENTICATION_KEY_COLUMN, 
Clob.class, null, null, true),
               new 
DBAccessor.DBColumnInfo(USER_AUTHENTICATION_CREATE_TIME_COLUMN, 
Timestamp.class, null, null, true),

-- 
To stop receiving notification emails like this one, please contact
amag...@apache.org.

Reply via email to