feat: create table with constraints (#19828)

This commit is contained in:
Jason Rasmussen 2025-07-09 09:13:14 -04:00 committed by GitHub
parent 4db76ddcf0
commit 51ab7498e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 170 additions and 60 deletions

View file

@ -19,7 +19,7 @@ describe(transformIndexes.name, () => {
},
reason: 'unknown',
}),
).toEqual('CREATE INDEX "IDX_test" ON "table1" ("column1")');
).toEqual('CREATE INDEX "IDX_test" ON "table1" ("column1");');
});
it('should create an unique index', () => {
@ -35,7 +35,7 @@ describe(transformIndexes.name, () => {
},
reason: 'unknown',
}),
).toEqual('CREATE UNIQUE INDEX "IDX_test" ON "table1" ("column1")');
).toEqual('CREATE UNIQUE INDEX "IDX_test" ON "table1" ("column1");');
});
it('should create an index with a custom expression', () => {
@ -51,7 +51,7 @@ describe(transformIndexes.name, () => {
},
reason: 'unknown',
}),
).toEqual('CREATE INDEX "IDX_test" ON "table1" ("id" IS NOT NULL)');
).toEqual('CREATE INDEX "IDX_test" ON "table1" ("id" IS NOT NULL);');
});
it('should create an index with a where clause', () => {
@ -68,7 +68,7 @@ describe(transformIndexes.name, () => {
},
reason: 'unknown',
}),
).toEqual('CREATE INDEX "IDX_test" ON "table1" ("id") WHERE ("id" IS NOT NULL)');
).toEqual('CREATE INDEX "IDX_test" ON "table1" ("id") WHERE ("id" IS NOT NULL);');
});
it('should create an index with a custom expression', () => {
@ -85,7 +85,7 @@ describe(transformIndexes.name, () => {
},
reason: 'unknown',
}),
).toEqual('CREATE INDEX "IDX_test" ON "table1" USING gin ("id" IS NOT NULL)');
).toEqual('CREATE INDEX "IDX_test" ON "table1" USING gin ("id" IS NOT NULL);');
});
});