Skip to content

Ensure all new database tables have a primary key defined

Not all existing tables have a primary key defined. This is due to historic reasons, where Rails did not support composite primary keys. Instead, we used unique keys for these tables.

For example, logical replication is dependent on either a primary key or a replica identity set on all tables.

This issue is about establishing a check (spec/rubocop) to make sure any newly added tables have a primary key defined.