Skip to content

Commit 5fa44f5

Browse files
committed
Temporarily drop departmentId rewrite to work around a bug. Upstream fix in progress.
1 parent 5c0aab6 commit 5fa44f5

File tree

2 files changed

+31
-21
lines changed

2 files changed

+31
-21
lines changed

dbschema/migrations/00041.edgeql

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CREATE MIGRATION m1xhtylawlv6ksvlfkuw6bien5fobo6mtlj3xgr33uya6hnhcnmn7a
2+
ONTO m1asch4l54f7eltalgtn3ft3kbtgzascsjujcjnonx6yloej5ujkpa
3+
{
4+
alter type default::Project {
5+
alter property departmentId {
6+
drop rewrite update;
7+
};
8+
};
9+
};

dbschema/project.esdl

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,28 @@ module default {
1414
constraint exclusive;
1515
constraint min_value(10000);
1616
constraint max_value(99999);
17-
rewrite update using (
18-
if (
19-
not exists .departmentId and
20-
.status <= Project::Status.Active and
21-
.step >= Project::Step.PendingFinanceConfirmation
22-
) then ((
23-
with
24-
fa := assert_exists(
25-
__subject__.primaryLocation.fundingAccount,
26-
message := "Project must have a primary location"
27-
),
28-
existing := (
29-
select detached Project.departmentId filter Project.primaryLocation.fundingAccount = fa
30-
),
31-
available := (
32-
range_unpack(range(fa.accountNumber * 10000 + 11, fa.accountNumber * 10000 + 9999))
33-
except existing
34-
)
35-
select min(available)
36-
)) else .departmentId
37-
);
17+
# Temporarily disabled. Upstream fix in progress.
18+
# rewrite update using (
19+
# if (
20+
# not exists .departmentId and
21+
# .status <= Project::Status.Active and
22+
# .step >= Project::Step.PendingFinanceConfirmation
23+
# ) then ((
24+
# with
25+
# fa := assert_exists(
26+
# __subject__.primaryLocation.fundingAccount,
27+
# message := "Project must have a primary location"
28+
# ),
29+
# existing := (
30+
# select detached Project.departmentId filter Project.primaryLocation.fundingAccount = fa
31+
# ),
32+
# available := (
33+
# range_unpack(range(fa.accountNumber * 10000 + 11, fa.accountNumber * 10000 + 9999))
34+
# except existing
35+
# )
36+
# select min(available)
37+
# )) else .departmentId
38+
# );
3839
};
3940

4041
required step: Project::Step {

0 commit comments

Comments
 (0)