zyratlo commented on code in PR #5055:
URL: https://github.com/apache/texera/pull/5055#discussion_r3305613532
##########
sql/texera_ddl.sql:
##########
@@ -435,6 +437,28 @@ CREATE TABLE IF NOT EXISTS computing_unit_user_access
FOREIGN KEY (uid) REFERENCES "user"(uid) ON DELETE CASCADE
);
+-- notebook table
+CREATE TABLE IF NOT EXISTS notebook
+(
+ nid SERIAL NOT NULL PRIMARY KEY,
+ wid INT NOT NULL,
+ notebook JSONB NOT NULL,
+ FOREIGN KEY (wid) REFERENCES workflow(wid) ON DELETE CASCADE
+);
Review Comment:
In the current prototype implementation, you are correct in that a workflow
will only ever have one notebook (a 1:1 relationship). However, the reason the
schema is designed this way is because we wanted to allow future work to make
the notebook editable and savable, which would create the situation where
multiple notebooks (or versions of the same notebook) are linked to the same
workflow. This is why we didn't make wid UNIQUE here.
Alternatively, another option is that we can make wid UNIQUE in this PR, and
when the aforementioned future work is done then we can make the schema change
to allow multiple notebooks for a workflow. What do you think?
--
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]