@@ -30,7 +30,8 @@ type Schema =
3030 "fk_author_id" ::: 'ForeignKey '["postRowAuthorId"] "users" '["userId"]] :=>
3131 '[
3232 "postRowId" ::: 'Def :=> 'NotNull 'PGint8,
33− "postRowAuthorId" ::: 'NoDef :=> 'NotNull 'PGint8
33+ "postRowAuthorId" ::: 'NoDef :=> 'NotNull 'PGint8,
34+ "postRowUpdateTime" ::: 'NoDef :=> 'NotNull 'PGtimestamptz
3435 ]),
3536 "quotes" ::: 'Table (
3637 '[
@@ -43,14 +44,12 @@ type Schema =
4344 "postElements" ::: 'Table (
4445 '[
4546 "fk_post_quote_self_id" ::: 'ForeignKey '["rowElementId"] "posts" '["postRowId"],
46− "fk_post_element_user_id" ::: 'ForeignKey '["rowElementAuthorId"] "users" '["userId"],
4747 "fk_post_quote_id" ::: 'ForeignKey '["rowElementQuote"] "quotes" '["quoteRowId"]
4848 -- ,
4949 -- "unique_post_quote" ::: 'Check '["rowElementOrd", "rowElementMarkdown", "rowElementLatex", "rowElementImage", "rowElementQuote", "rowElementAttachment"]
5050 ] :=>
5151 '[
5252 "rowElementId" ::: 'NoDef :=> 'NotNull 'PGint8,
53− "rowElementAuthorId" ::: 'NoDef :=> 'NotNull 'PGint8,
5453 "rowElementOrd" ::: 'NoDef :=> 'NotNull 'PGint8,
5554 "rowElementMarkdown" ::: 'NoDef :=> 'Null 'PGtext,
5655 "rowElementLatex" ::: 'NoDef :=> 'Null 'PGtext,
@@ -61,14 +60,12 @@ type Schema =
6160 "quoteElements" ::: 'Table (
6261 '[
6362 "fk_quotes_quote_self_id" ::: 'ForeignKey '["rowElementId"] "quotes" '["quoteRowId"],
64− "fk_quote_element_user_id" ::: 'ForeignKey '["rowElementAuthorId"] "users" '["userId"],
6563 "fk_quote_quote_id" ::: 'ForeignKey '["rowElementQuote"] "quotes" '["quoteRowId"]
6664 -- ,
6765 -- "unique_quote_quote" ::: 'Check '["rowElementOrd", "rowElementMarkdown", "rowElementLatex", "rowElementImage", "rowElementQuote", "rowElementAttachment"]
6866 ] :=>
6967 '[
7068 "rowElementId" ::: 'NoDef :=> 'NotNull 'PGint8,
71− "rowElementAuthorId" ::: 'NoDef :=> 'NotNull 'PGint8,
7269 "rowElementOrd" ::: 'NoDef :=> 'NotNull 'PGint8,
7370 "rowElementMarkdown" ::: 'NoDef :=> 'Null 'PGtext,
7471 "rowElementLatex" ::: 'NoDef :=> 'Null 'PGtext,
@@ -101,7 +98,8 @@ createTables = createTable #users (
10198 primaryKey #userId `as` #pk_users
10299 ) >>> createTable #posts (
103100 serial8 `as` #postRowId :*
104− notNullable int8 `as` #postRowAuthorId
101+ notNullable int8 `as` #postRowAuthorId :*
102+ notNullable timestampWithTimeZone `as` #postRowUpdateTime
105103 ) (
106104 primaryKey #postRowId `as` #pk_posts :*
107105 foreignKey #postRowAuthorId #users #userId OnDeleteCascade OnUpdateCascade `as` #fk_author_id
@@ -113,7 +111,6 @@ createTables = createTable #users (
113111 foreignKey #quoteRowPostId #posts #postRowId OnDeleteCascade OnUpdateCascade `as` #fk_quote_post_id
114112 ) >>> createTable #postElements (
115113 notNullable int8 `as` #rowElementId :*
116− notNullable int8 `as` #rowElementAuthorId :*
117114 notNullable int8 `as` #rowElementOrd :*
118115 nullable text `as` #rowElementMarkdown :*
119116 nullable text `as` #rowElementLatex :*
@@ -122,11 +119,9 @@ createTables = createTable #users (
122119 nullable text `as` #rowElementAttachment
123120 ) (
124121 foreignKey #rowElementId #posts #postRowId OnDeleteCascade OnUpdateCascade `as` #fk_post_quote_self_id :*
125− foreignKey #rowElementAuthorId #users #userId OnDeleteCascade OnUpdateCascade `as` #fk_post_element_user_id :*
126122 foreignKey #rowElementQuote #quotes #quoteRowId OnDeleteCascade OnUpdateCascade `as` #fk_post_quote_id
127123 ) >>> createTable #quoteElements (
128124 notNullable int8 `as` #rowElementId :*
129− notNullable int8 `as` #rowElementAuthorId :*
130125 notNullable int8 `as` #rowElementOrd :*
131126 nullable text `as` #rowElementMarkdown :*
132127 nullable text `as` #rowElementLatex :*
@@ -135,7 +130,6 @@ createTables = createTable #users (
135130 nullable text `as` #rowElementAttachment
136131 ) (
137132 foreignKey #rowElementId #quotes #quoteRowId OnDeleteCascade OnUpdateCascade `as` #fk_quotes_quote_self_id :*
138− foreignKey #rowElementAuthorId #users #userId OnDeleteCascade OnUpdateCascade `as` #fk_quote_element_user_id :*
139133 foreignKey #rowElementQuote #quotes #quoteRowId OnDeleteCascade OnUpdateCascade `as` #fk_quote_quote_id
140134 -- ) >>> createView #postsView (select (
141135 -- #posts ! #postRowId :*