Skip to content

Commit 1c330ca

Browse files
committed
Only test unnamed constraints support for MySQL
1 parent 88f2df3 commit 1c330ca

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

test/ddl/create_table.test.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ describe("create table", () => {
228228
it(`formats CREATE TABLE with named column constraints`, async () => {
229229
await test(dedent`
230230
CREATE TABLE client (
231-
id INT CONSTRAINT NOT NULL CONSTRAINT prim_key PRIMARY KEY
231+
id INT CONSTRAINT foo NOT NULL CONSTRAINT prim_key PRIMARY KEY
232232
)
233233
`);
234234
});
@@ -244,6 +244,15 @@ describe("create table", () => {
244244
`);
245245
});
246246

247+
it(`formats CREATE TABLE with unnamed table and column constraints`, async () => {
248+
await testMysql(dedent`
249+
CREATE TABLE client (
250+
id INT CONSTRAINT CHECK (TRUE),
251+
CONSTRAINT CHECK (id > 0)
252+
)
253+
`);
254+
});
255+
247256
it(`formats constraints with ON CONFLICT clause`, async () => {
248257
await test(dedent`
249258
CREATE TABLE client (

0 commit comments

Comments
 (0)