diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-06-27 17:45:51 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-06-27 17:45:51 +0000 |
commit | 327cb0cc545b215c84beab1ff7e449094c79d184 (patch) | |
tree | a622a746c4850296e5df5403ccf8f69c542732c8 | |
parent | c7b4a3513c21474d163b3487fa417ebb80212881 (diff) | |
parent | 344849f560c19d0a69ce4627f600f1905bb8f91c (diff) | |
download | nova-327cb0cc545b215c84beab1ff7e449094c79d184.tar.gz nova-327cb0cc545b215c84beab1ff7e449094c79d184.tar.xz nova-327cb0cc545b215c84beab1ff7e449094c79d184.zip |
Merge "Sync db.models.Quota* with migrations."
-rw-r--r-- | nova/db/sqlalchemy/models.py | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/nova/db/sqlalchemy/models.py b/nova/db/sqlalchemy/models.py index 9b6d849d3..183a42f60 100644 --- a/nova/db/sqlalchemy/models.py +++ b/nova/db/sqlalchemy/models.py @@ -367,11 +367,12 @@ class Quota(BASE, NovaBase): """ __tablename__ = 'quotas' + __table_args__ = () id = Column(Integer, primary_key=True) - project_id = Column(String(255), index=True) + project_id = Column(String(255), nullable=True) - resource = Column(String(255)) + resource = Column(String(255), nullable=False) hard_limit = Column(Integer, nullable=True) @@ -384,11 +385,14 @@ class QuotaClass(BASE, NovaBase): """ __tablename__ = 'quota_classes' + __table_args__ = ( + Index('ix_quota_classes_class_name', 'class_name'), + ) id = Column(Integer, primary_key=True) - class_name = Column(String(255), index=True) + class_name = Column(String(255), nullable=True) - resource = Column(String(255)) + resource = Column(String(255), nullable=True) hard_limit = Column(Integer, nullable=True) @@ -396,13 +400,16 @@ class QuotaUsage(BASE, NovaBase): """Represents the current usage for a given resource.""" __tablename__ = 'quota_usages' + __table_args__ = ( + Index('ix_quota_usages_project_id', 'project_id'), + ) id = Column(Integer, primary_key=True) - project_id = Column(String(255), index=True) - resource = Column(String(255)) + project_id = Column(String(255), nullable=True) + resource = Column(String(255), nullable=True) - in_use = Column(Integer) - reserved = Column(Integer) + in_use = Column(Integer, nullable=False) + reserved = Column(Integer, nullable=False) @property def total(self): |