diff --git a/grammar.js b/grammar.js index 46014146..98eef00f 100644 --- a/grammar.js +++ b/grammar.js @@ -2553,7 +2553,8 @@ module.exports = grammar({ choice( $.keyword_stored, $.keyword_virtual, - ) + ), + $.keyword_unique )), _check_constraint: $ => seq( diff --git a/test/corpus/create.txt b/test/corpus/create.txt index 2e66be84..3717b38d 100644 --- a/test/corpus/create.txt +++ b/test/corpus/create.txt @@ -30,7 +30,8 @@ Create table multiple columns CREATE TABLE my_table ( id BIGINT NOT NULL PRIMARY KEY, - date DATE DEFAULT NULL ASC + date DATE DEFAULT NULL ASC, + date2 DATE DEFAULT NULL UNIQUE ASC ); -------------------------------------------------------------------------------- @@ -57,6 +58,15 @@ CREATE TABLE my_table ( (keyword_default) (literal (keyword_null)) + (direction + (keyword_asc))) + (column_definition + name: (identifier) + type: (keyword_date) + (keyword_default) + (literal + (keyword_null)) + (keyword_unique) (direction (keyword_asc)))))))