Merge "Add unique constraint to environment table"

This commit is contained in:
Jenkins 2015-05-27 14:25:48 +00:00 committed by Gerrit Code Review
commit b33f772714

View File

@ -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,