{"schemas":"# in: user\n# out: post, comment\nDEFINE TABLE OVERWRITE comment SCHEMALESS;\n\nDEFINE FIELD OVERWRITE content ON comment TYPE string;\nDEFINE FIELD OVERWRITE created_at ON comment TYPE datetime DEFAULT time::now();\nDEFINE TABLE OVERWRITE post SCHEMALESS;\n\nDEFINE FIELD OVERWRITE title ON post TYPE string;\nDEFINE FIELD OVERWRITE content ON post TYPE string;\nDEFINE FIELD OVERWRITE author ON post TYPE record;\nDEFINE FIELD OVERWRITE created_at ON post TYPE datetime DEFAULT time::now();\nDEFINE FIELD OVERWRITE status ON post TYPE string DEFAULT 'DRAFT' ASSERT $value IN ['DRAFT', 'PUBLISHED'];\nDEFINE TABLE OVERWRITE script_migration SCHEMAFULL;\n\nDEFINE FIELD OVERWRITE script_name ON script_migration TYPE string;\nDEFINE FIELD OVERWRITE executed_at ON script_migration TYPE datetime DEFAULT time::now();\nDEFINE TABLE OVERWRITE user SCHEMALESS;\n\nDEFINE FIELD OVERWRITE username ON user TYPE string;\nDEFINE FIELD OVERWRITE email ON user TYPE string ASSERT string::is::email($value);\nDEFINE FIELD OVERWRITE password ON user TYPE string;\nDEFINE FIELD OVERWRITE registered_at ON user TYPE datetime DEFAULT time::now();","events":"DEFINE TABLE OVERWRITE publish_post SCHEMALESS;\n\nDEFINE FIELD OVERWRITE post_id ON publish_post;\nDEFINE FIELD OVERWRITE created_at ON publish_post TYPE datetime DEFAULT time::now();\n\nDEFINE EVENT OVERWRITE publish_post ON TABLE publish_post WHEN $event == \"CREATE\" THEN (\n UPDATE post SET status = \"PUBLISHED\" WHERE id = $after.post_id\n);\nDEFINE TABLE OVERWRITE unpublish_post SCHEMALESS;\n\nDEFINE FIELD OVERWRITE post_id ON unpublish_post;\nDEFINE FIELD OVERWRITE created_at ON unpublish_post TYPE datetime DEFAULT time::now();\n\nDEFINE EVENT OVERWRITE unpublish_post ON TABLE unpublish_post WHEN $event == \"CREATE\" THEN (\n UPDATE post SET status = \"DRAFT\" WHERE id = $after.post_id\n);"}