-
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
15 changed files
with
81 additions
and
63 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
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);" | ||
"schemas": "# in: user\n# out: post, comment\nDEFINE TABLE comment SCHEMALESS;\n\nDEFINE FIELD content ON comment TYPE string;\nDEFINE FIELD created_at ON comment TYPE datetime DEFAULT 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>;\nDEFINE FIELD created_at ON post TYPE datetime DEFAULT time::now();\nDEFINE FIELD status ON post TYPE string DEFAULT 'DRAFT' ASSERT $value IN ['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 DEFAULT time::now();\nDEFINE TABLE user SCHEMALESS;\n\nDEFINE FIELD username ON user TYPE string;\nDEFINE FIELD email ON user TYPE string ASSERT string::is::email($value);\nDEFINE FIELD password ON user TYPE string;\nDEFINE FIELD registered_at ON user TYPE datetime DEFAULT 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 DEFAULT 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 DEFAULT 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
DEFINE TABLE script_migration SCHEMAFULL; | ||
|
||
DEFINE FIELD script_name ON script_migration TYPE string; | ||
DEFINE FIELD executed_at ON script_migration TYPE datetime VALUE $before OR time::now(); | ||
DEFINE FIELD executed_at ON script_migration TYPE datetime DEFAULT time::now(); |
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,6 +1,6 @@ | ||
DEFINE TABLE user SCHEMALESS; | ||
|
||
DEFINE FIELD username ON user TYPE string ASSERT $value != NONE; | ||
DEFINE FIELD email ON user TYPE string ASSERT is::email($value); | ||
DEFINE FIELD password ON user TYPE string ASSERT $value != NONE; | ||
DEFINE FIELD registered_at ON user TYPE datetime VALUE $before OR time::now(); | ||
DEFINE FIELD username ON user TYPE string; | ||
DEFINE FIELD email ON user TYPE string ASSERT string::is::email($value); | ||
DEFINE FIELD password ON user TYPE string; | ||
DEFINE FIELD registered_at ON user TYPE datetime DEFAULT time::now(); |
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