Hello,
I stumbled across a lack of support for remarks (comments) when dealing with H2 databases. H2 supports the SQL standard COMMENT ON... syntax. I had a look in the source code and it seemed like low hanging fruit, so I sucessfully applied the following patch:
- ---
- .../java/liquibase/sqlgenerator/core/SetColumnRemarksGenerator.java | 4 +++-
- .../java/liquibase/sqlgenerator/core/SetTableRemarksGenerator.java | 3 ++-
- 2 files changed, 5 insertions(+), 2 deletions(-)
- diff --git a/liquibase-core/src/main/java/liquibase/sqlgenerator/core/SetColumnRemarksGenerator.java b/liquibase-core/src/main/java/liquibase/sqlgenerator/core/SetColumnRemarksGenerator.java
- index ec76acf..3661150 100644
- --- a/liquibase-core/src/main/java/liquibase/sqlgenerator/core/SetColumnRemarksGenerator.java
- +++ b/liquibase-core/src/main/java/liquibase/sqlgenerator/core/SetColumnRemarksGenerator.java
- @@ -4,6 +4,7 @@ import liquibase.database.Database;
- import liquibase.database.core.DB2Database;
- import liquibase.database.core.OracleDatabase;
- import liquibase.database.core.PostgresDatabase;
- +import liquibase.database.core.H2Database;
- import liquibase.exception.ValidationErrors;
- import liquibase.sql.Sql;
- import liquibase.sql.UnparsedSql;
- @@ -20,7 +21,8 @@ public class SetColumnRemarksGenerator extends AbstractSqlGenerator<SetColumnRem
- @Override
- public boolean supports(SetColumnRemarksStatement statement, Database database) {
- - return database instanceof OracleDatabase || database instanceof PostgresDatabase || database instanceof DB2Database;
- + return database instanceof OracleDatabase || database instanceof PostgresDatabase || database instanceof DB2Database
- + || database instanceof H2Database;
- }
- @Override
- diff --git a/liquibase-core/src/main/java/liquibase/sqlgenerator/core/SetTableRemarksGenerator.java b/liquibase-core/src/main/java/liquibase/sqlgenerator/core/SetTableRemarksGenerator.java
- index a4bf263..dfc6e20 100644
- --- a/liquibase-core/src/main/java/liquibase/sqlgenerator/core/SetTableRemarksGenerator.java
- +++ b/liquibase-core/src/main/java/liquibase/sqlgenerator/core/SetTableRemarksGenerator.java
- @@ -5,6 +5,7 @@ import liquibase.database.core.DB2Database;
- import liquibase.database.core.MySQLDatabase;
- import liquibase.database.core.OracleDatabase;
- import liquibase.database.core.PostgresDatabase;
- +import liquibase.database.core.H2Database;
- import liquibase.exception.ValidationErrors;
- import liquibase.sql.Sql;
- import liquibase.sql.UnparsedSql;
- @@ -18,7 +19,7 @@ public class SetTableRemarksGenerator extends AbstractSqlGenerator<SetTableRemar
- @Override
- public boolean supports(SetTableRemarksStatement statement, Database database) {
- return database instanceof MySQLDatabase || database instanceof OracleDatabase || database instanceof PostgresDatabase
- - || database instanceof DB2Database;
- + || database instanceof DB2Database || database instanceof H2Database;
- }
- @Override
- --
Thanks,
Sam