diff --git a/README.md b/README.md index 04300823..526f576c 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ fordfrog@fordfrog.com. * MATERIALIZED VIEW support in PostgreSQL 9.3 (Marti Raudsepp) * Better support for inherited tables (Daniel Watson) * Added support for CREATE UNLOGGED TABLE (Anatoliy Basov) - +* Added support for /**/ comments (yulei) #### Fixes * Added hint to use "CREATE TABLE ... CONSTRAINT name PRIMARY KEY/UNIQUE ..." diff --git a/src/test/java/cz/startnet/utils/pgdiff/PgDiffTest.java b/src/test/java/cz/startnet/utils/pgdiff/PgDiffTest.java index b8d78da1..973ef517 100644 --- a/src/test/java/cz/startnet/utils/pgdiff/PgDiffTest.java +++ b/src/test/java/cz/startnet/utils/pgdiff/PgDiffTest.java @@ -224,7 +224,10 @@ public static Collection parameters() { // Tests scenario where new UNLOGGED TABLE is added. {"add_unlogged_table", false, false, false, false}, // Tests scenario where UNLOGGED TABLE is dropped. - {"drop_unlogged_table", false, false, false, false} + {"drop_unlogged_table", false, false, false, false}, + // Test scenarios where /**/ comments. + {"add_table_issue115", false, false, false, false}, + {"add_column_issue134", false, false, false, false} }); } /** diff --git a/src/test/resources/cz/startnet/utils/pgdiff/add_column_issue134_diff.sql b/src/test/resources/cz/startnet/utils/pgdiff/add_column_issue134_diff.sql new file mode 100644 index 00000000..b1adc2ef --- /dev/null +++ b/src/test/resources/cz/startnet/utils/pgdiff/add_column_issue134_diff.sql @@ -0,0 +1,2 @@ +ALTER TABLE test1 + ADD COLUMN type SMALLINT; \ No newline at end of file diff --git a/src/test/resources/cz/startnet/utils/pgdiff/add_column_issue134_new.sql b/src/test/resources/cz/startnet/utils/pgdiff/add_column_issue134_new.sql new file mode 100644 index 00000000..1f97c34f --- /dev/null +++ b/src/test/resources/cz/startnet/utils/pgdiff/add_column_issue134_new.sql @@ -0,0 +1,5 @@ +CREATE table "test1" ( +"id" BIGINT, +"type" SMALLINT /* 1: aaa, 2:bbb */, +"value" VARCHAR(255) +); \ No newline at end of file diff --git a/src/test/resources/cz/startnet/utils/pgdiff/add_column_issue134_original.sql b/src/test/resources/cz/startnet/utils/pgdiff/add_column_issue134_original.sql new file mode 100644 index 00000000..3217302d --- /dev/null +++ b/src/test/resources/cz/startnet/utils/pgdiff/add_column_issue134_original.sql @@ -0,0 +1,4 @@ +CREATE table "test1" ( +"id" BIGINT, +"value" VARCHAR(255) +); \ No newline at end of file diff --git a/src/test/resources/cz/startnet/utils/pgdiff/add_table_issue115_diff.sql b/src/test/resources/cz/startnet/utils/pgdiff/add_table_issue115_diff.sql new file mode 100644 index 00000000..c7fed4a4 --- /dev/null +++ b/src/test/resources/cz/startnet/utils/pgdiff/add_table_issue115_diff.sql @@ -0,0 +1,3 @@ +CREATE TABLE test2 ( + id serial NOT NULL +); \ No newline at end of file diff --git a/src/test/resources/cz/startnet/utils/pgdiff/add_table_issue115_new.sql b/src/test/resources/cz/startnet/utils/pgdiff/add_table_issue115_new.sql new file mode 100644 index 00000000..03abddf1 --- /dev/null +++ b/src/test/resources/cz/startnet/utils/pgdiff/add_table_issue115_new.sql @@ -0,0 +1,4 @@ +/* create table begin */ +create table "test2"( +"id" serial NOT NULL +); \ No newline at end of file diff --git a/src/test/resources/cz/startnet/utils/pgdiff/add_table_issue115_original.sql b/src/test/resources/cz/startnet/utils/pgdiff/add_table_issue115_original.sql new file mode 100644 index 00000000..e69de29b