element-hq / element-hq/synapse

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

Open
#16,648 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#16648](https://github.com/matrix-org/synapse/pull/16648).

---

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


Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.