Skip to content

Commit

Permalink
Update Project schema with Budget related triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanjnelson committed Nov 16, 2023
1 parent f2abe03 commit 94dbef5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions dbschema/project.esdl
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,24 @@ module default {
message := "A Project's own context should be itself (no more or less)"
)
);

trigger createBudgetOnInsert after insert for each do (
insert default::Budget {
project := __new__.project,
projectContext := __new__.projectContext,
}
);

trigger updateBudgetSensitivityOnSensitivityChange after update for each do (
update (
select default::Budget
filter .project = __new__.project
set {
.sensitivity := __new__.sensitivity,
.ownSensitivity := __new__.ownSensitivity,
}
)
);
}

type TranslationProject extending Project {
Expand Down

0 comments on commit 94dbef5

Please sign in to comment.