Skip to content

Commit

Permalink
Merge pull request #2084 from taozhi8833998/fix-constarint-quoted-name
Browse files Browse the repository at this point in the history
fix: constraint with quoted name
  • Loading branch information
taozhi8833998 authored Aug 27, 2024
2 parents 1790dce + fce3407 commit b769eac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions pegjs/postgresql.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'CASE': true,
'CREATE': true,
'CONTAINS': true,
'CONSTRAINT': true,
'CURRENT_DATE': true,
'CURRENT_TIME': true,
'CURRENT_TIMESTAMP': true,
Expand Down
10 changes: 10 additions & 0 deletions test/postgres.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1912,6 +1912,16 @@ describe('Postgres', () => {
'CREATE SCHEMA public'
]
},
{
title: 'create constraint with quoted name',
sql: [
`CREATE TABLE "User" (
"id" SERIAL NOT NULL,
CONSTRAINT "User_pkey" PRIMARY KEY ("id")
);`,
'CREATE TABLE "User" ("id" SERIAL NOT NULL, CONSTRAINT "User_pkey" PRIMARY KEY ("id"))'
]
},
]
neatlyNestTestedSQL(SQL_LIST)
})
Expand Down

0 comments on commit b769eac

Please sign in to comment.