Closed FlorisFokkinga closed 2 months ago
mysql> show create table tags;
| tags | CREATE TABLE `tags` (
`id` int NOT NULL AUTO_INCREMENT,
`tag_value` varchar(255) NOT NULL,
`organisation_id` int NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `tag_organisation_unique_name` (`tag_value`,`organisation_id`),
KEY `collaboration_tags_ibfk_2` (`organisation_id`),
CONSTRAINT `tags_ibfk_1` FOREIGN KEY (`organisation_id`) REFERENCES `organisations` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=743 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
Works! Also tested the migration on prod data: works without a hitch!
Occur in production in the SRC organisation.
Specifically, this query:
I think that
(tag_value,org_id)
should be unique in the db, but that would require storing the organisation in the tags table. That would make sense, I guess, because tags are tightly coupled to an Org, and tags between orgs should not interact in any way.