mirror of
https://github.com/immich-app/immich.git
synced 2025-11-19 08:02:37 +09:00
22 lines
540 B
TypeScript
22 lines
540 B
TypeScript
import { schemaDiffToSql } from 'src/sql-tools';
|
|
import { describe, expect, it } from 'vitest';
|
|
|
|
describe(schemaDiffToSql.name, () => {
|
|
describe('comments', () => {
|
|
it('should include the reason in a SQL comment', () => {
|
|
expect(
|
|
schemaDiffToSql(
|
|
[
|
|
{
|
|
type: 'index.drop',
|
|
indexName: 'IDX_test',
|
|
reason: 'unknown',
|
|
},
|
|
],
|
|
{ comments: true },
|
|
),
|
|
).toEqual([`DROP INDEX "IDX_test"; -- unknown`]);
|
|
});
|
|
});
|
|
});
|