add name for audit, changes for watcher api/db

Change-Id: Ibe04f5375d741d15999fde6faf767f15311c6351
Implements:blueprint add-name-for-audit
This commit is contained in:
suzhengwei
2017-06-19 18:57:44 +08:00
parent 50935af15f
commit d7d56cbd79
17 changed files with 215 additions and 74 deletions

View File

@@ -166,10 +166,12 @@ class Audit(Base):
__tablename__ = 'audits'
__table_args__ = (
UniqueConstraint('uuid', name='uniq_audits0uuid'),
UniqueConstraint('name', 'deleted', name='uniq_audits0name'),
table_args()
)
id = Column(Integer, primary_key=True, autoincrement=True)
uuid = Column(String(36))
name = Column(String(63), nullable=True)
audit_type = Column(String(20))
state = Column(String(20), nullable=True)
parameters = Column(JSONEncodedDict, nullable=True)