mirror of
https://github.com/immich-app/immich.git
synced 2025-12-12 10:54:09 +09:00
feat: extension, triggers, functions, comments, parameters management in sql-tools (#17269)
feat: sql-tools extension, triggers, functions, comments, parameters
This commit is contained in:
21
server/src/sql-tools/to-sql/index.spec.ts
Normal file
21
server/src/sql-tools/to-sql/index.spec.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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`]);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user