fix: triggers typing and yaml conv

This commit is contained in:
Nybkox
2024-12-18 06:05:49 +01:00
parent 413287c691
commit 5f4bd6d3e3
2 changed files with 2 additions and 1 deletions

View File

@@ -234,6 +234,7 @@ export function databaseInfoFromYamlModel(filesOrDbInfo: DatabaseModelFile[] | D
if (file.name.endsWith('.trigger.sql')) {
model.triggers.push({
objectId: `triggers:${file.name.slice(0, -'.trigger.sql'.length)}`,
pureName: file.name.slice(0, -'.trigger.sql'.length),
createSql: file.text,
});

View File

@@ -139,7 +139,7 @@ export interface FunctionInfo extends CallableObjectInfo {
export interface TriggerInfo extends SqlObjectInfo {
objectId: string;
functionName?: string;
tableName: string;
tableName?: string;
triggerTiming?: 'BEFORE' | 'AFTER' | 'INSTEAD OF' | null;
triggerLevel?: 'ROW' | 'STATEMENT';
eventType?: 'INSERT' | 'UPDATE' | 'DELETE' | 'TRUNCATE';