Skip to content

Commit

Permalink
Re-worked SMALLINT fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wwillard7800 committed Mar 23, 2020
1 parent 55bfaa0 commit 08ca6f9
Showing 1 changed file with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,20 @@ public DatabaseDataType toDatabaseDataType(Database database) {

if (database instanceof PostgresDatabase)
{
if (! isAutoIncrement()) {
return new DatabaseDataType("SMALLINT"); //always smallint regardless of parameters passed
}
int majorVersion = 9;
try {
majorVersion = database.getDatabaseMajorVersion();
} catch (DatabaseException e) {
// ignore
}
if (majorVersion < 10) {
return new DatabaseDataType("SMALLSERIAL");
if (isAutoIncrement()) {
int majorVersion = 9;
try {
majorVersion = database.getDatabaseMajorVersion();
} catch (DatabaseException e) {
// ignore
}
if (majorVersion < 10) {
return new DatabaseDataType("SMALLSERIAL");
}
}
return new DatabaseDataType("SMALLINT"); //always smallint regardless of parameters passed
}


return super.toDatabaseDataType(database);
}

Expand Down

0 comments on commit 08ca6f9

Please sign in to comment.