Skip to content

Commit ba40ccd

Browse files
committed
add test case for #5129
1 parent 3a98f3a commit ba40ccd

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

drizzle-kit/tests/postgres/pg-enums.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2201,3 +2201,23 @@ test('enums defaults', async () => {
22012201
'CREATE TABLE "table" (\n\t"col1" "en1" DEFAULT \'active\'::"en1",\n\t"col2" "en2" DEFAULT \'inactive\'::"en2"\n);\n',
22022202
]);
22032203
});
2204+
2205+
// https://github.com/drizzle-team/drizzle-orm/issues/5129
2206+
test('enums camelcase', async () => {
2207+
const en1 = pgEnum('camelCase', ['active', 'inactive']);
2208+
2209+
const to = {
2210+
en1,
2211+
table: pgTable('table', {
2212+
col1: en1().default('active'),
2213+
}),
2214+
};
2215+
2216+
const res = await diff({}, to, []);
2217+
await push({ db, to });
2218+
2219+
expect(res.sqlStatements).toStrictEqual([
2220+
"CREATE TYPE \"camelCase\" AS ENUM('active', 'inactive');",
2221+
'CREATE TABLE "table" (\n\t"col1" "camelCase" DEFAULT \'active\'::"camelCase"\n);\n',
2222+
]);
2223+
});

0 commit comments

Comments
 (0)