Skip to content

Commit

Permalink
Update Derby to latest and add index creation in sql Helper class.
Browse files Browse the repository at this point in the history
  • Loading branch information
spelletier committed Mar 3, 2015
1 parent 0e014a1 commit 634c3d5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1958,11 +1958,14 @@ public int varcharLargeColumnWidth() {

@Override
public String sqlForCreateUniqueIndex(String indexName, String tableName, ColumnIndex... columnIndexes) {
NSMutableArray<String> columnNames = new NSMutableArray<String>();
for (ColumnIndex columnIndex : columnIndexes) {
columnNames.addObject(columnIndex.columnName());
}
return "CREATE UNIQUE INDEX " + indexName + " ON " + tableName + "(" + columnNames.componentsJoinedByString(",") + ")";
NSArray<String> columnNames = columnNamesFromColumnIndexes(columnIndexes);
return "CREATE UNIQUE INDEX \""+indexName+"\" ON "+tableName+" (" + columnNames.componentsJoinedByString(",") + ")";
}

@Override
public String sqlForCreateIndex(String indexName, String tableName, ColumnIndex... columnIndexes) {
NSArray<String> columnNames = columnNamesFromColumnIndexes(columnIndexes);
return "CREATE INDEX \""+indexName+"\" ON "+tableName+ " ("+columnNames.componentsJoinedByString(", ")+")";
}

/**
Expand Down
Binary file modified Frameworks/PlugIns/DerbyPlugIn/Libraries/derby.jar
Binary file not shown.
Binary file modified Frameworks/PlugIns/DerbyPlugIn/Libraries/derbytools.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,8 @@ public NSArray<EOSQLExpression> foreignKeyConstraintStatementsForRelationship(EO
// MS: did i write this code? sorry about that everything. this is crazy.
constraint.append("\"");

fkSql.append(')');
// BOO
//fkSql.append(") DEFERRABLE INITIALLY DEFERRED");
// New with version 10.11, by default constraint are now immediate
fkSql.append(") DEFERRABLE INITIALLY DEFERRED");

if (USE_NAMED_CONSTRAINTS)
sql.append(constraint);
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -597,12 +597,12 @@
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.4.2.0</version>
<version>10.11.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbytools</artifactId>
<version>10.4.2.0</version>
<version>10.11.1.1</version>
</dependency>
<dependency>
<groupId>net.sf.ezmorph</groupId>
Expand Down

0 comments on commit 634c3d5

Please sign in to comment.