mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat: create table with constraints (#19828)
This commit is contained in:
parent
4db76ddcf0
commit
51ab7498e9
7 changed files with 170 additions and 60 deletions
|
|
@ -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);');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue