The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/6613

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From 5f2a8104b773faddbcea61ef233978eff613567e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Thu, 12 Dec 2019 14:27:46 -0500
Subject: [PATCH] lxd/db: Add missing unique key
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 lxd/db/cluster/update.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lxd/db/cluster/update.go b/lxd/db/cluster/update.go
index 5e2114197c..a4ffcc1f16 100644
--- a/lxd/db/cluster/update.go
+++ b/lxd/db/cluster/update.go
@@ -66,7 +66,8 @@ CREATE TABLE images_profiles (
        image_id INTEGER NOT NULL,
        profile_id INTEGER NOT NULL,
        FOREIGN KEY (image_id) REFERENCES images (id) ON DELETE CASCADE,
-       FOREIGN KEY (profile_id) REFERENCES profiles (id) ON DELETE CASCADE
+       FOREIGN KEY (profile_id) REFERENCES profiles (id) ON DELETE CASCADE,
+       UNIQUE (image_id, profile_id)
 );
 INSERT INTO images_profiles (image_id, profile_id) 
        SELECT images.id, profiles.id FROM images
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to