engine/schema: add unique constraint for sshkeys UUID column (#5565)

This adds unique constraints much like other tables, instead of using
query that maybe incompatible with older 5.x mysql servers.

Fixes #5564

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2021-10-12 18:38:30 +05:30 committed by GitHub
parent 4ed916d639
commit ad8f3750c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,4 +19,4 @@
-- Schema upgrade cleanup from 4.15.2.0 to 4.16.0.0
--;
ALTER TABLE `cloud`.`ssh_keypairs` MODIFY COLUMN `uuid` varchar(40) NOT NULL UNIQUE;
ALTER TABLE `cloud`.`ssh_keypairs` ADD CONSTRAINT `uc_ssh_keypairs__uuid` UNIQUE (`uuid`);