mirror of
https://github.com/immich-app/immich.git
synced 2025-12-25 01:11:43 +03:00
fix(sql-tools): null default (#20796)
This commit is contained in:
@@ -116,6 +116,20 @@ describe(transformColumns.name, () => {
|
||||
}),
|
||||
).toEqual([`ALTER TABLE "table1" ALTER COLUMN "column1" SET DEFAULT uuid_generate_v4();`]);
|
||||
});
|
||||
|
||||
it('should update the default value to NULL', () => {
|
||||
expect(
|
||||
transformColumns(ctx, {
|
||||
type: 'ColumnAlter',
|
||||
tableName: 'table1',
|
||||
columnName: 'column1',
|
||||
changes: {
|
||||
default: 'NULL',
|
||||
},
|
||||
reason: 'unknown',
|
||||
}),
|
||||
).toEqual([`ALTER TABLE "table1" ALTER COLUMN "column1" SET DEFAULT NULL;`]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('ColumnDrop', () => {
|
||||
|
||||
Reference in New Issue
Block a user