Skip to content

[Notebook Migration] Remove unnecessary primary key in notebook table database schema #4307

Closed as not planned

Description

@yunyad

Task Summary

Currently the database schema looks like this: (see screenshot)

Image

We introduce two new tables, the notebook and workflow_notebook_mapping table. The notebook table holds the JSONB notebook and uses the wid from the workflow table as well as a nid (notebook ID) field as its primary key. The workflow_notebook_mapping table holds the JSONB mapping and uses three foreign keys in combination as its primary key. However, after discussion we agreed that the wid field in the notebook table is redundant and not needed. This is because the notebook should be read-only, so if the user modifies the notebook we will instead create a new workflow. Thus only the nid is needed.

Proposed Solution or Design

We will change the wid field in the notebook table to no longer be a primary key:

Image

This decision was made because we do not need the wid to be part of the primary key, since the nid is sufficient for our final user experience design.

Priority

P2 – Medium

Task Type

  • Code Implementation
  • Documentation
  • Refactor / Cleanup
  • Testing / QA
  • DevOps / Deployment

Activity

  1. added theissue type on Mar 17, 2026
  2. chenlica commented on Mar 18, 2026

    @chenlica
    Contributor

    @yunyad The subject is too general and vague. Please improve it.

  3. changed the title [-]Database schema[/-] [+]Update Database Schema (Complete)[/+] on Mar 18, 2026
  4. changed the title [-]Update Database Schema (Complete)[/-] [+]Modify Notebook Table in Database[/+] on Mar 18, 2026
  5. changed the title [-]Modify Notebook Table in Database[/-] [+][Notebook Migration] Remove unnecessary primary key in notebook table database schema[/+] on Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions