Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add a test which ensures that new tables get PRIMARY KEYs. #16648

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

reivilibre
Copy link
Contributor

@reivilibre reivilibre commented Nov 16, 2023

We have a history, even recently, of not using PRIMARY KEYs and many of the cases seem tragically just because someone was unaware that it is good practice / maybe cribbed off earlier schema deltas. In many cases a UNIQUE index was created instead when that could've been a PRIMARY KEY.

This PR adds a test that flags up missing PRIMARY KEYs.

Base: develop

Original commit schedule, with full messages:

  1. Add a PRIMARY KEY lint

Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
@reivilibre reivilibre requested a review from a team as a code owner November 16, 2023 12:23
Copy link
Member

@erikjohnston erikjohnston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we not enforce that the table either has a primary key or a replica identity?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants