Skip to content

Commit 92ddc71

Browse files
committed
Merge branch 'develop'
2 parents b71d9af + 3f30675 commit 92ddc71

File tree

102 files changed

+1830
-526
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+1830
-526
lines changed

.yarn/patches/edgedb-npm-1.4.0-902d833279.patch

Lines changed: 0 additions & 12 deletions
This file was deleted.

dbschema/common.esdl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module default {
22
global currentUserId: uuid;
3+
alias currentUser := <User>(global currentUserId);
34

45
scalar type ReportPeriod extending enum<Monthly, Quarterly>;
56

@@ -15,4 +16,6 @@ module default {
1516
)
1617
)
1718
);
19+
20+
scalar type RichText extending json;
1821
}

dbschema/engagement.esdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module default {
3737
rewrite insert, update using (.endDate if .status = Engagement::Status.InDevelopment else .initialEndDate);
3838
};
3939

40-
description: json;
40+
description: RichText;
4141
}
4242

4343
type LanguageEngagement extending Engagement {

dbschema/file.esdl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ module File {
2323
public: bool;
2424

2525
required createdBy: default::User {
26-
default := <default::User>(global default::currentUserId);
26+
default := default::currentUser;
2727
};
2828
required modifiedBy: default::User {
29-
default := <default::User>(global default::currentUserId);
30-
rewrite update using (<default::User>(global default::currentUserId));
29+
default := default::currentUser;
30+
rewrite update using (default::currentUser);
3131
# TODO trigger change up the tree
3232
# TODO trigger re-eval on node delete?
3333
};

dbschema/funding-account.esdl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ module default {
55
}
66

77
required accountNumber: int16 {
8-
constraint min_value(0);
9-
constraint max_value(9);
8+
constraint expression on (__subject__ >= 0 and __subject__ <= 9);
109
}
1110
}
1211
}

dbschema/language.esdl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module default {
2-
type Language extending Resource, Project::ContextAware, Mixin::Named, Mixin::Pinnable, Mixin::Taggable {
2+
type Language extending Mixin::Postable, Resource, Project::ContextAware, Mixin::Named, Mixin::Pinnable, Mixin::Taggable {
33
required displayName: str {
44
default := .name;
55
}
@@ -24,11 +24,12 @@ module default {
2424
.<language[is Ethnologue::Language]
2525
));
2626
trigger connectEthnologue after insert for each do (
27-
insert Ethnologue::Language {
27+
(select Ethnologue::Language filter .language = __new__) ??
28+
(insert Ethnologue::Language {
2829
language := __new__,
2930
ownSensitivity := __new__.ownSensitivity,
3031
projectContext := __new__.projectContext
31-
}
32+
})
3233
);
3334
trigger matchEthnologueToOwnSens after update for each do (
3435
update __new__.ethnologue
@@ -87,7 +88,7 @@ module default {
8788
}
8889

8990
scalar type population extending int32 {
90-
constraint min_value(0);
91+
constraint expression on (__subject__ >= 0);
9192
}
9293
}
9394

dbschema/migrations/00038.edgeql

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
CREATE MIGRATION m1wdw2srbtq3ondtyuhcobwgcbdawourtp4vcapedti3kca2wh46dq
2+
ONTO m1xzy4deu3w7kduilieoiydxysopymo7skj4sftggjen4vi3og6kaq
3+
{
4+
CREATE MODULE Post IF NOT EXISTS;
5+
CREATE ABSTRACT TYPE Mixin::Embedded {
6+
CREATE REQUIRED SINGLE LINK container: default::Resource;
7+
};
8+
CREATE SCALAR TYPE Post::Shareability EXTENDING enum<Membership, Internal, AskToShareExternally, External>;
9+
CREATE SCALAR TYPE Post::Type EXTENDING enum<Note, Story, Prayer>;
10+
CREATE TYPE default::Post EXTENDING default::Resource, Mixin::Embedded, Mixin::Owned {
11+
ALTER LINK container {
12+
SET SINGLE;
13+
ON TARGET DELETE DELETE SOURCE;
14+
SET OWNED;
15+
SET REQUIRED;
16+
};
17+
CREATE SINGLE PROPERTY isMember := (.container[IS Project::ContextAware].isMember);
18+
CREATE SINGLE PROPERTY sensitivity := (.container[IS Project::ContextAware].sensitivity);
19+
CREATE REQUIRED PROPERTY body: std::json;
20+
CREATE REQUIRED PROPERTY shareability: Post::Shareability;
21+
CREATE REQUIRED PROPERTY type: Post::Type;
22+
};
23+
CREATE ABSTRACT TYPE Mixin::Postable EXTENDING default::Resource {
24+
CREATE LINK posts := (.<container[IS default::Post]);
25+
};
26+
ALTER TYPE default::Post {
27+
CREATE TRIGGER enforcePostable
28+
AFTER UPDATE, INSERT
29+
FOR EACH DO (std::assert((__new__.container IS Mixin::Postable), message := "A Post's container must be a Postable"));
30+
};
31+
ALTER TYPE Scripture::Verse {
32+
ALTER PROPERTY chapter {
33+
DROP CONSTRAINT std::min_value(1);
34+
};
35+
};
36+
ALTER TYPE Scripture::Verse {
37+
ALTER PROPERTY chapter {
38+
CREATE CONSTRAINT std::min_value(1);
39+
};
40+
};
41+
ALTER TYPE Scripture::Verse {
42+
ALTER PROPERTY verse {
43+
DROP CONSTRAINT std::min_value(1);
44+
};
45+
};
46+
ALTER TYPE Scripture::Verse {
47+
ALTER PROPERTY verse {
48+
CREATE CONSTRAINT std::min_value(1);
49+
};
50+
};
51+
ALTER TYPE Scripture::Verse {
52+
ALTER PROPERTY verseId {
53+
DROP CONSTRAINT std::min_value(0);
54+
};
55+
};
56+
ALTER TYPE Scripture::Verse {
57+
ALTER PROPERTY verseId {
58+
CREATE CONSTRAINT std::min_value(0);
59+
};
60+
};
61+
ALTER TYPE default::FundingAccount {
62+
ALTER PROPERTY accountNumber {
63+
DROP CONSTRAINT std::min_value(0);
64+
};
65+
};
66+
ALTER TYPE default::FundingAccount {
67+
ALTER PROPERTY accountNumber {
68+
CREATE CONSTRAINT std::min_value(0);
69+
};
70+
};
71+
ALTER TYPE default::Project {
72+
ALTER PROPERTY departmentId {
73+
DROP CONSTRAINT std::min_value(10000);
74+
};
75+
};
76+
ALTER TYPE default::Project {
77+
ALTER PROPERTY departmentId {
78+
CREATE CONSTRAINT std::min_value(10000);
79+
};
80+
};
81+
ALTER SCALAR TYPE default::population {
82+
DROP CONSTRAINT std::min_value(0);
83+
};
84+
ALTER SCALAR TYPE default::population {
85+
CREATE CONSTRAINT std::min_value(0);
86+
};
87+
};

dbschema/migrations/00039.edgeql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CREATE MIGRATION m1zqlgbrht5kontkpocymsg2f7wit5rsxkmgy6uy56myfyhncrvlvq
2+
ONTO m1wdw2srbtq3ondtyuhcobwgcbdawourtp4vcapedti3kca2wh46dq
3+
{
4+
ALTER TYPE default::Project EXTENDING Mixin::Postable BEFORE default::Resource;
5+
ALTER TYPE default::Language EXTENDING Mixin::Postable BEFORE default::Resource;
6+
ALTER TYPE default::Partner EXTENDING Mixin::Postable BEFORE default::Resource;
7+
};

dbschema/migrations/00040.edgeql

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
CREATE MIGRATION m1asch4l54f7eltalgtn3ft3kbtgzascsjujcjnonx6yloej5ujkpa
2+
ONTO m1zqlgbrht5kontkpocymsg2f7wit5rsxkmgy6uy56myfyhncrvlvq
3+
{
4+
ALTER TYPE default::Language {
5+
ALTER TRIGGER connectEthnologue USING (((SELECT
6+
Ethnologue::Language
7+
FILTER
8+
(.language = __new__)
9+
) ?? (INSERT
10+
Ethnologue::Language
11+
{
12+
language := __new__,
13+
ownSensitivity := __new__.ownSensitivity,
14+
projectContext := __new__.projectContext
15+
})));
16+
};
17+
};

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+
};

0 commit comments

Comments
 (0)