Skip to content

Commit

Permalink
Changed order of table type updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin McCluney committed Jan 10, 2024
1 parent 4b47b9e commit 1c5f6f2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Binary file modified CCDD.jar
Binary file not shown.
28 changes: 14 additions & 14 deletions src/CCDD/CcddDbTableCommandHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -8690,20 +8690,18 @@ protected void modifyTableType(String typeName,
// Get the database form of the table name
String dbTable = dbControl.getQuotedName(protoName);

// Step through each addition
for (String add[] : typeAdditions)
// Step through each deletion
for (String[] del : typeDeletions)
{
// Get the column name in database form
String dbColumn = tableTypeHandler.convertVisibleToDatabase(add[0],
add[1],
isStructure);
String dbColumn = tableTypeHandler.convertVisibleToDatabase(del[0], del[1], isStructure);

// Append the add command
// Append the delete command
command.append("ALTER TABLE ")
.append(dbTable)
.append(" ADD COLUMN ")
.append(" DROP COLUMN ")
.append(dbColumn)
.append(" text DEFAULT ''; ");
.append("; ");

// Check if the length of the command string has reached the limit
if (command.length() >= ModifiableSizeInfo.MAX_SQL_COMMAND_LENGTH.getSize())
Expand Down Expand Up @@ -8771,18 +8769,20 @@ protected void modifyTableType(String typeName,
}
}

// Step through each deletion
for (String[] del : typeDeletions)
// Step through each addition
for (String add[] : typeAdditions)
{
// Get the column name in database form
String dbColumn = tableTypeHandler.convertVisibleToDatabase(del[0], del[1], isStructure);
String dbColumn = tableTypeHandler.convertVisibleToDatabase(add[0],
add[1],
isStructure);

// Append the delete command
// Append the add command
command.append("ALTER TABLE ")
.append(dbTable)
.append(" DROP COLUMN ")
.append(" ADD COLUMN ")
.append(dbColumn)
.append("; ");
.append(" text DEFAULT ''; ");

// Check if the length of the command string has reached the limit
if (command.length() >= ModifiableSizeInfo.MAX_SQL_COMMAND_LENGTH.getSize())
Expand Down

0 comments on commit 1c5f6f2

Please sign in to comment.