matrix-org / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://matrix-org.github.io/synapse
Apache License 2.0
11.82k stars 2.13k forks source link

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

Open reivilibre opened 11 months ago

reivilibre commented 11 months ago

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