-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved Sybase ASE Support #665
Improved Sybase ASE Support #665
Conversation
Thanks for your pull request! Here’s what happens next: A member of the Liquibase team will take a look at your contribution and may suggest:
The PR will be prioritized according to our internal development and testing capacity. We’ll let you know when it’s ready to move to the next step or if any changes are needed. |
Hi @carlos940513 , would you please resolve the branch conflicts and consider adding tests? Thanks, Ronak |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review and test results:
After resolving conflicts, the list of things still needing fixed by this PR are:
- Fixed view definition snapshot logic to remove "create view as" if the database returns it
- Fixed handling of bigint/int/smallint/tinyint when arguments are specified (sybase does not support them)
- Better ignore columns that start with "sybfi" which are system-managed
- Better handling of foreign key onUpdate/onDelete (sybase does not support them)
- Better handling of numbers being used as booleans that have trailing non-number content in them
Things to be aware of:
- Changes are limited to sybase
Things to worry about:
- Not good test automation around sybase to see and test that the changes work. But they all appear to make sense to me and as we add sybase testing support, it will catch regressions if any of these changes get undone
liquibase-core/src/main/java/liquibase/database/core/SybaseDatabase.java
Outdated
Show resolved
Hide resolved
liquibase-core/src/main/java/liquibase/database/core/SybaseDatabase.java
Outdated
Show resolved
Hide resolved
@@ -70,6 +70,9 @@ public DatabaseDataType toDatabaseDataType(Database database) { | |||
} | |||
} | |||
} | |||
if (database instanceof SybaseDatabase) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the SybaseASADatabase and SybaseDatabase "ifs" be included as an "or" in the "if" at line 56?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were actually already checking for sybase up on line 44 so I just moved SybaseASA up there.
It doesn't super matter, I had just left it as it came though in the merge
@@ -72,6 +72,9 @@ public DatabaseDataType toDatabaseDataType(Database database) { | |||
if (database instanceof SybaseASADatabase) { | |||
return new DatabaseDataType("INTEGER"); | |||
} | |||
if (database instanceof SybaseDatabase) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar question to the one in BigIntType.java. Can this be moved to be an "or" in the "if" at line 65?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can but doesn't really matter. I moved it since I was taking a couple things out otherwise.
@@ -61,7 +61,9 @@ public DatabaseDataType toDatabaseDataType(Database database) { | |||
} | |||
return new DatabaseDataType("SMALLINT"); //always smallint regardless of parameters passed | |||
} | |||
|
|||
if (database instanceof SybaseDatabase) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the SybaseASADatabase also be included in this logic? Same question for TinyIntType.java.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about smallint vs. tinyint. I didn't go hunting through their docs on what datatypes they support and was just reviewing this PR for the fixes it specifically had.
import liquibase.database.jvm.JdbcConnection; | ||
import liquibase.database.core.MariaDBDatabase; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were these imports for DB2Database, MSSQLDatabase and MariaDBDatabase removed by accident?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No accidentally. With the merge from master, I did a "fix code layout" which also removes unneeded imports. If they were needed, the compile would have failed.
@@ -80,6 +82,8 @@ public Sql[] generateSql(AddForeignKeyConstraintStatement statement, Database da | |||
// see "REFERENCES Clause" in manual | |||
} else if ((database instanceof FirebirdDatabase) && "RESTRICT".equalsIgnoreCase(statement.getOnDelete())) { | |||
//don't use | |||
} else if (database instanceof SybaseDatabase) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should SybaseASADatabase be here, too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure. This PR was just for sybase support, not sybase asa so didn't look at that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nvoxland, hello - Will you please take a look at my comments?
CHANGES REQUESTED
…40513/liquibase into carlos940513-Liquibase-sybase-changes
…inor refactorings
Hey @XDelphiGrl , Could you please take a look to this PR when you have a chance? I have addressed I think most of the comments you have made here? Thanks, |
…ase-sybase-changes # Conflicts: # liquibase-core/src/main/java/liquibase/datatype/core/BigIntType.java # liquibase-core/src/main/java/liquibase/datatype/core/IntType.java # liquibase-core/src/main/java/liquibase/datatype/core/SmallIntType.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review and testing results:
Overall changes look ok to me. The only things I did here were:
- Fixed unit tests failing.
- Update some IF blocks from Data Types classes as suggested in some of the review comments.
Things to be aware of:
- These changes have only an impact on Sybase and SybaseASADatabase DBs.
Things to worry about:
- Nothing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several improvements for Sybase ASE handling are introduced in this PR. See this comment for a comprehensive list.
- New tests added for numeric datatype handling.
- Automated functional and test harness executions passing.
- No additional testing required.
APPROVED
Changes made on this PR are listed below: