5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-07 01:10:26 +08:00

SQOOP-1625: Repository upgrade issue

(Qian Xu via Jarek Jarcec Cecho)
This commit is contained in:
Jarek Jarcec Cecho 2014-10-28 07:05:49 -07:00
parent eed2b3f50a
commit 9a1135d477
2 changed files with 4 additions and 4 deletions

View File

@ -439,13 +439,13 @@ public void createOrUpgradeRepository(Connection conn) {
// Change direction from VARCHAR to BIGINT + foreign key.
updateDirections(conn, insertDirections(conn));
renameConnectorToConfigurable(conn);
}
// Add unique constraints on job and links for version 4 onwards
if (repositoryVersion > 3) {
// Add unique constraints on job and links for version 4 onwards
runQuery(QUERY_UPGRADE_TABLE_SQ_JOB_ADD_UNIQUE_CONSTRAINT_NAME, conn);
runQuery(QUERY_UPGRADE_TABLE_SQ_LINK_ADD_UNIQUE_CONSTRAINT_NAME, conn);
runQuery(QUERY_UPGRADE_TABLE_SQ_CONFIGURABLE_ADD_UNIQUE_CONSTRAINT_NAME, conn);
}
// last step upgrade the repository version to the latest value in the code
upgradeRepositoryVersion(conn);
}

View File

@ -580,7 +580,7 @@ public void loadJobs(int version) throws Exception {
for(String type : new String[] {"IMPORT", "EXPORT"}) {
for(String name : new String[] {"JA", "JB"} ) {
runQuery("INSERT INTO SQOOP.SQ_JOB(SQB_NAME, SQB_CONNECTION, SQB_TYPE)"
+ " VALUES('" + name + "', 1, '" + type + "')");
+ " VALUES('" + type + "_" + name + "', 1, '" + type + "')");
}
}