Describe the bug
There are several things to fix in the DB schema
Additional context
- Bug:
instances.cluster_id is an INTEGER but it refers to clusters.id which is BIGINT
- Bug:
events.resource_id is an INTEGER but clusters.id and instances.id are BIGINT
- Not using
RESOURCE_TYPE in events table nor its CHECK statement
- Logical Bug:
cluster_tags omits repeated tags but HAVING COUNT(*) > 1 does the opposite
Describe the bug
There are several things to fix in the DB schema
Additional context
instances.cluster_idis an INTEGER but it refers toclusters.idwhich is BIGINTevents.resource_idis an INTEGER butclusters.idandinstances.idare BIGINTRESOURCE_TYPEineventstable nor itsCHECKstatementcluster_tagsomits repeated tags butHAVING COUNT(*) > 1does the opposite