-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
67 additions
and
49 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"schemas": "# in: user\n# out: post, comment\nDEFINE TABLE comment SCHEMALESS;\n\nDEFINE FIELD content ON comment TYPE string ASSERT $value != NONE;\nDEFINE FIELD created_at ON comment TYPE datetime VALUE $before OR time::now();\nDEFINE TABLE post SCHEMALESS;\n\nDEFINE FIELD title ON post TYPE string;\nDEFINE FIELD content ON post TYPE string;\nDEFINE FIELD author ON post TYPE record (user) ASSERT $value != NONE;\nDEFINE FIELD created_at ON post TYPE datetime VALUE $before OR time::now();\nDEFINE FIELD status ON post TYPE string VALUE $value OR $before OR 'DRAFT' ASSERT $value == NONE OR $value INSIDE ['DRAFT', 'PUBLISHED'];\nDEFINE TABLE script_migration SCHEMAFULL;\n\nDEFINE FIELD script_name ON script_migration TYPE string;\nDEFINE FIELD executed_at ON script_migration TYPE datetime VALUE $before OR time::now();\nDEFINE TABLE user SCHEMALESS;\n\nDEFINE FIELD username ON user TYPE string ASSERT $value != NONE;\nDEFINE FIELD email ON user TYPE string ASSERT is::email($value);\nDEFINE FIELD password ON user TYPE string ASSERT $value != NONE;\nDEFINE FIELD registered_at ON user TYPE datetime VALUE $before OR time::now();", | ||
"events": "DEFINE TABLE publish_post SCHEMALESS;\n\nDEFINE FIELD post_id ON publish_post;\nDEFINE FIELD created_at ON publish_post TYPE datetime VALUE $before OR time::now();\n\nDEFINE EVENT publish_post ON TABLE publish_post WHEN $event == "CREATE" THEN (\n UPDATE post SET status = \"PUBLISHED\" WHERE id = $after.post_id\n);\nDEFINE TABLE unpublish_post SCHEMALESS;\n\nDEFINE FIELD post_id ON unpublish_post;\nDEFINE FIELD created_at ON unpublish_post TYPE datetime VALUE $before OR time::now();\n\nDEFINE EVENT unpublish_post ON TABLE unpublish_post WHEN $event == "CREATE" THEN (\n UPDATE post SET status = \"DRAFT\" WHERE id = $after.post_id\n);" | ||
"events": "DEFINE TABLE publish_post SCHEMALESS;\n\nDEFINE FIELD post_id ON publish_post;\nDEFINE FIELD created_at ON publish_post TYPE datetime VALUE $before OR time::now();\n\nDEFINE EVENT publish_post ON TABLE publish_post WHEN $event == \"CREATE\" THEN (\n UPDATE post SET status = \"PUBLISHED\" WHERE id = $after.post_id\n);\nDEFINE TABLE unpublish_post SCHEMALESS;\n\nDEFINE FIELD post_id ON unpublish_post;\nDEFINE FIELD created_at ON unpublish_post TYPE datetime VALUE $before OR time::now();\n\nDEFINE EVENT unpublish_post ON TABLE unpublish_post WHEN $event == \"CREATE\" THEN (\n UPDATE post SET status = \"DRAFT\" WHERE id = $after.post_id\n);" | ||
} |
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
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
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