yangzhang75 commented on code in PR #8125:
URL: https://github.com/apache/texera/pull/8125#discussion_r3899641158


##########
sql/texera_ddl.sql:
##########
@@ -166,7 +166,10 @@ CREATE TABLE IF NOT EXISTS workflow
     content            TEXT NOT NULL,
     creation_time      TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
     last_modified_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
-    is_public          BOOLEAN NOT NULL DEFAULT false
+    is_public          BOOLEAN NOT NULL DEFAULT false,
+    -- Which view the workflow opens in by default (CANVAS or FORM); the 
form's definition
+    -- lives in workflow.content (`formBinding`).
+    default_view   VARCHAR NOT NULL DEFAULT 'CANVAS'

Review Comment:
   Good call, switched it to a PG enum. `default_view_enum AS ENUM ('CANVAS', 
'FORM')` in both the DDL and 44.sql, so the DB rejects rogue values on every 
write path, and jOOQ now generates a typed `DefaultViewEnum`: the column, the 
POJO getter/setter, and the response DTO field are all the enum rather than a 
String. The set-default-view endpoint parses the request body into it via 
`DefaultViewEnum.valueOf` (an invalid value is a 400).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to