-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2936 from SeedCompany/edgedb/file
[EdgeDB] First WIP pass at file schema to get something for other places
- Loading branch information
Showing
4 changed files
with
54 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
module default { | ||
type Directory extending File::Node { | ||
# TODO how to update | ||
required totalFiles: int32 { | ||
default := 0; | ||
}; | ||
} | ||
|
||
# TODO how to front latest version info? | ||
type File extending File::Node { | ||
required mimeType: str; | ||
} | ||
} | ||
|
||
module File { | ||
type Version extending Node { | ||
required mimeType: str; | ||
} | ||
|
||
abstract type Node extending default::Resource, Mixin::Named { | ||
# TODO how to default to parent? | ||
# optional to have tri-state. idk if needed but that's what I implemented in neo4j | ||
public: bool; | ||
|
||
required createdBy: default::User { | ||
default := <default::User>(global default::currentUserId); | ||
}; | ||
required modifiedBy: default::User { | ||
default := <default::User>(global default::currentUserId); | ||
rewrite update using (<default::User>(global default::currentUserId)); | ||
# TODO trigger change up the tree | ||
# TODO trigger re-eval on node delete? | ||
}; | ||
|
||
# TODO trigger directories evaluate | ||
required size: int64; | ||
|
||
link parent: Node; | ||
multi link parents: Node { | ||
# a way to determine order? | ||
depth: int16; # todo enforce | ||
} | ||
# multi link children: Node; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters