diff options
author | Boris Pavlovic <boris@pavlovic.me> | 2013-06-08 12:41:04 +0400 |
---|---|---|
committer | Boris Pavlovic <boris@pavlovic.me> | 2013-06-08 19:36:22 +0400 |
commit | 57290516365e2d786c50b1e99ddbefa75997ad6d (patch) | |
tree | c1fdac946b8e879ac13f2a02c35f4bc6dce1f842 /nova/db/sqlalchemy/models.py | |
parent | 08d6c1dd3d8819a73c35c2c59ac5e50224fb9a73 (diff) | |
download | nova-57290516365e2d786c50b1e99ddbefa75997ad6d.tar.gz nova-57290516365e2d786c50b1e99ddbefa75997ad6d.tar.xz nova-57290516365e2d786c50b1e99ddbefa75997ad6d.zip |
Fix db.models.Service description
DB models definition should be up-to-date with DB schema obtained after applying of
migrations. Currently, there are no tests enforcing this and it's really hard to
analyze what indexes should be added, and what indexes we have at the moment.
So the first step is it to fix all models, and add missing descriptions about
Indexes and UniqueConstraints in __table_args__ and use explicit 'nullable'
parameter in columns description.
Add missing 'nullable' parameters to all Columns
Add empty __table_args__ parameter to Table
There is no indexes and no unique constraints in this table at this moment.
blueprint db-sync-models-with-migrations
Change-Id: I9b31e8976f514e370d6b46076b469fe5e5c8e0f1
Diffstat (limited to 'nova/db/sqlalchemy/models.py')
-rw-r--r-- | nova/db/sqlalchemy/models.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/nova/db/sqlalchemy/models.py b/nova/db/sqlalchemy/models.py index c4660226f..418e05cfa 100644 --- a/nova/db/sqlalchemy/models.py +++ b/nova/db/sqlalchemy/models.py @@ -45,10 +45,12 @@ class Service(BASE, NovaBase): """Represents a running service on a host.""" __tablename__ = 'services' + __table_args__ = () + id = Column(Integer, primary_key=True) - host = Column(String(255)) # , ForeignKey('hosts.id')) - binary = Column(String(255)) - topic = Column(String(255)) + host = Column(String(255), nullable=True) # , ForeignKey('hosts.id')) + binary = Column(String(255), nullable=True) + topic = Column(String(255), nullable=True) report_count = Column(Integer, nullable=False, default=0) disabled = Column(Boolean, default=False) |