-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.esdl
More file actions
40 lines (30 loc) · 943 Bytes
/
default.esdl
File metadata and controls
40 lines (30 loc) · 943 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
module default {
type User {
required name: str;
required age: int32;
multi link posts := .<author[is Post];
multi link comments := .<author[is Comment];
}
type Post {
required title: str;
required content: str;
required published: bool;
required property created_at -> datetime {
# Set the default value to the current timestamp
default := datetime_current();
}
required author: User;
multi link comments := .<parentPost[is Comment];
}
type Comment {
required text: str;
required property created_at -> datetime {
# Set the default value to the current timestamp
default := datetime_current();
}
parentPost: Post;
parentComment: Comment;
required author: User;
multi link replies := .<parentComment[is Comment];
}
}