File tree Expand file tree Collapse file tree
drizzle-kit/tests/postgres Expand file tree Collapse file tree Original file line number Diff line number Diff 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+ } ) ;
You can’t perform that action at this time.
0 commit comments