mirror of
https://github.com/immich-app/immich.git
synced 2025-12-01 09:49:53 +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:
41
server/test/sql-tools/trigger-name-default.stub.ts
Normal file
41
server/test/sql-tools/trigger-name-default.stub.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import { DatabaseSchema, Table, Trigger } from 'src/sql-tools';
|
||||
|
||||
@Table()
|
||||
@Trigger({
|
||||
timing: 'before',
|
||||
actions: ['insert'],
|
||||
scope: 'row',
|
||||
functionName: 'function1',
|
||||
})
|
||||
export class Table1 {}
|
||||
|
||||
export const description = 'should register a trigger with a default name';
|
||||
export const schema: DatabaseSchema = {
|
||||
name: 'postgres',
|
||||
schemaName: 'public',
|
||||
functions: [],
|
||||
enums: [],
|
||||
extensions: [],
|
||||
parameters: [],
|
||||
tables: [
|
||||
{
|
||||
name: 'table1',
|
||||
columns: [],
|
||||
indexes: [],
|
||||
triggers: [
|
||||
{
|
||||
name: 'TR_ca71832b10b77ed600ef05df631',
|
||||
tableName: 'table1',
|
||||
functionName: 'function1',
|
||||
actions: ['insert'],
|
||||
scope: 'row',
|
||||
timing: 'before',
|
||||
synchronize: true,
|
||||
},
|
||||
],
|
||||
constraints: [],
|
||||
synchronize: true,
|
||||
},
|
||||
],
|
||||
warnings: [],
|
||||
};
|
||||
Reference in New Issue
Block a user