8000 Postgresl REFERENCES with multiple keys doesn't appear to render · Issue #1047 · chartdb/chartdb · GitHub
[go: up one dir, main page]

Skip to content

Postgresl REFERENCES with multiple keys doesn't appear to render #1047

@jeanbza

Description

@jeanbza

I have this:

CREATE TABLE repo_prs (
    repo_id BIGINT NOT NULL REFERENCES repos(repo_id) ON DELETE CASCADE,
    pr_number INT,
    created TIMESTAMP,
    merged TIMESTAMP,
    PRIMARY KEY(repo_id, pr_number)
);

CREATE TABLE pr_reviewers (
    repo_id BIGINT NOT NULL,
    pr_number INT NOT NULL,
    reviewer_email VARCHAR(255) NOT NULL,
    num_comments INT NOT NULL,
    approved BOOL NOT NULL,
    PRIMARY KEY(repo_id, pr_number, reviewer_email),
    FOREIGN KEY (repo_id, pr_number)
    REFERENCES repo_prs(repo_id, pr_number) ON DELETE CASCADE
);

Which renders:

Image

It's missing foreign references from repo_id and pr_number from pr_reviewers to repo_prs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0