Skip to content

Commit f1ebcff

Browse files
committed
add functionality tests
1 parent 33e2b39 commit f1ebcff

1 file changed

Lines changed: 39 additions & 1 deletion

File tree

test/node/src/schema.test.ts

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2528,10 +2528,48 @@ for (const dialect of DIALECTS) {
25282528

25292529
await builder.execute()
25302530
})
2531+
2532+
it('should drop multiple types', async () => {
2533+
await ctx.db.schema.createType('species').execute()
2534+
await ctx.db.schema.createType('colors').execute()
2535+
2536+
const builder = ctx.db.schema
2537+
.dropType(['species', 'colors'])
2538+
.ifExists()
2539+
2540+
testSql(builder, dialect, {
2541+
postgres: {
2542+
sql: `drop type if exists "species", "colors"`,
2543+
parameters: [],
2544+
},
2545+
mysql: NOT_SUPPORTED,
2546+
mssql: NOT_SUPPORTED,
2547+
sqlite: NOT_SUPPORTED,
2548+
})
2549+
2550+
await builder.execute()
2551+
})
2552+
2553+
it('should drop multiple types if exists', async () => {
2554+
await ctx.db.schema.createType('species').execute()
2555+
const builder = ctx.db.schema.dropType(['species', 'colors']).ifExists()
2556+
2557+
testSql(builder, dialect, {
2558+
postgres: {
2559+
sql: `drop type if exists "species", "colors"`,
2560+
parameters: [],
2561+
},
2562+
mysql: NOT_SUPPORTED,
2563+
mssql: NOT_SUPPORTED,
2564+
sqlite: NOT_SUPPORTED,
2565+
})
2566+
2567+
await builder.execute()
2568+
})
25312569
}
25322570

25332571
async function cleanup() {
2534-
await ctx.db.schema.dropType('species').ifExists().execute()
2572+
await ctx.db.schema.dropType(['species', 'colors']).ifExists().execute()
25352573
}
25362574
})
25372575

0 commit comments

Comments
 (0)