Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TJDB: As a user I should be able to create foreign keys on table creation #9038

Closed
akshaysasidrn opened this issue Mar 8, 2024 · 3 comments

Comments

@akshaysasidrn
Copy link
Collaborator

akshaysasidrn commented Mar 8, 2024

Is your proposal related to a problem?

The user is not able to form relations b/w tables

Describe the solution you'd like

PRD: link
ADR: link
Design: link

On table creation, a user should be able to create a foreign key constraint on a column being created

  • User can click on Add relation to open FK creation drawer
  • The subsequent drawer that opens can be used to select source, target and actions
  • On creating the selection, it should be represented on the FK relation section
  • Clicking on create should show success/error toast
  • Foreign key relations should be shown on the link icons on hover as per design

Constraints to note:

  • Referential integrity: foreign key must reference an existing primary key value in another table or be nullable
  • Matching data types: foreign key and the referenced primary key must have matching or compatible data types
  • Deletion and Update rules: Set rules to avoid or allow orphaned rows in target table
image image image image
@mansukh-tj
Copy link
Collaborator

mansukh-tj commented Mar 11, 2024

If user clicks on link icon next to a column, prefilled FK screen opens up with the following details pre filled

  1. Type as Single Foreign Key
  2. Table and Column name of the column whose link icon was clicked

@mansukh-tj
Copy link
Collaborator

Action for updating and deleting target FK value are as follows
image

Refer Feature 18 & 19 in the PRD

@mansukh-tj
Copy link
Collaborator

Limit Self refrential foreign keys - not permitted in TJ DB

@akshaysasidrn akshaysasidrn changed the title TJDB: As a user I should be able to create foriegn keys on table creation TJDB: As a user I should be able to create foreign keys on table creation Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants