Skip to content

Commit cb84538

Browse files
[EdgeDB] Create Education & Unavailability types in User schema (#2971)
Co-authored-by: Carson Full <[email protected]>
1 parent 0cf2e57 commit cb84538

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

dbschema/migrations/00032.edgeql

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
CREATE MIGRATION m1hb7zty3d4ekb5ftznc4tv4h5mgkxy6db42zbxylaw2rmrpveqsxq
2+
ONTO m1wzaeho6j66fhwcmgkeezkp52hqwxgc27uy7yqsdgml3qekc2iarq
3+
{
4+
CREATE SCALAR TYPE User::Degree EXTENDING enum<Primary, Secondary, Associates, Bachelors, Masters, Doctorate>;
5+
CREATE TYPE User::Education EXTENDING default::Resource {
6+
CREATE REQUIRED PROPERTY degree: User::Degree;
7+
CREATE REQUIRED PROPERTY institution: std::str;
8+
CREATE REQUIRED PROPERTY major: std::str;
9+
};
10+
ALTER TYPE default::User {
11+
CREATE MULTI LINK education: User::Education {
12+
ON TARGET DELETE ALLOW;
13+
};
14+
};
15+
CREATE TYPE User::Unavailability EXTENDING default::Resource {
16+
CREATE REQUIRED PROPERTY dates: range<cal::local_date>;
17+
CREATE REQUIRED PROPERTY description: std::str;
18+
};
19+
ALTER TYPE default::User {
20+
CREATE MULTI LINK unavailabilities: User::Unavailability {
21+
ON TARGET DELETE ALLOW;
22+
};
23+
};
24+
};

dbschema/user.esdl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ module default {
2424
multi link pins: Mixin::Pinnable {
2525
on target delete allow;
2626
}
27+
multi link education: User::Education {
28+
on target delete allow;
29+
}
30+
multi link unavailabilities: User::Unavailability {
31+
on target delete allow;
32+
}
2733
}
2834

2935
alias RootUser := (
@@ -33,5 +39,25 @@ module default {
3339
}
3440

3541
module User {
42+
type Education extending default::Resource {
43+
required degree: Degree;
44+
required major: str;
45+
required institution: str;
46+
}
47+
48+
type Unavailability extending default::Resource {
49+
required description: str;
50+
required dates: range<cal::local_date>;
51+
}
52+
3653
scalar type Status extending enum<Active, Disabled>;
54+
55+
scalar type Degree extending enum<
56+
Primary,
57+
Secondary,
58+
Associates,
59+
Bachelors,
60+
Masters,
61+
Doctorate
62+
>;
3763
}

0 commit comments

Comments
 (0)