From 1a84e6f7296d532875bae07510826629aaba4566 Mon Sep 17 00:00:00 2001 From: Dmytro Dovbii Date: Mon, 25 May 2015 19:38:57 +0300 Subject: [PATCH] Add unique constraint to environment table Change-Id: Ia491c957ebd29fb27614623e6f8ef6bd327e9449 Partial-Bug: #1415436 --- murano/db/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/murano/db/models.py b/murano/db/models.py index ed87fc47..45710579 100644 --- a/murano/db/models.py +++ b/murano/db/models.py @@ -56,6 +56,8 @@ Base = declarative.declarative_base(cls=_MuranoBase) class Environment(Base, TimestampMixin): """Represents a Environment in the metadata-store.""" __tablename__ = 'environment' + __table_args__ = (sa.Index( + 'ix_name_tenant_id', 'name', 'tenant_id', unique=True),) id = sa.Column(sa.String(255), primary_key=True,