From 474b0b3aaa6a46f5d000822c7c3fc38ad16fbd06 Mon Sep 17 00:00:00 2001 From: zhanggang Date: Mon, 16 Jul 2018 11:27:34 +0800 Subject: Sync the data fields of DB* class and table fields. This update try to fix some problems: 1. define the 'id' both in _data_fields and _auto_generated_attrs. 2. some of tables don't have the 'id' field. 3. _data_fields of DBInstance miss some table fields. 4. Change the key of persisted_models as the same of table name to make it more readable. Change-Id: I0ad96824e8de978ff5b6766085549b1e1a2509cf Signed-off-by: zhanggang --- trove/module/models.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'trove/module') diff --git a/trove/module/models.py b/trove/module/models.py index b9962aa6..975ef13b 100644 --- a/trove/module/models.py +++ b/trove/module/models.py @@ -446,17 +446,19 @@ class InstanceModule(object): class DBInstanceModule(models.DatabaseModelBase): _data_fields = [ - 'id', 'instance_id', 'module_id', 'md5', 'created', + 'instance_id', 'module_id', 'md5', 'created', 'updated', 'deleted', 'deleted_at'] + _table_name = 'instance_modules' class DBModule(models.DatabaseModelBase): _data_fields = [ - 'id', 'name', 'type', 'contents', 'description', + 'name', 'type', 'contents', 'description', 'tenant_id', 'datastore_id', 'datastore_version_id', 'auto_apply', 'visible', 'live_update', - 'priority_apply', 'apply_order', 'is_admin', - 'md5', 'created', 'updated', 'deleted', 'deleted_at'] + 'md5', 'created', 'updated', 'deleted', 'deleted_at', + 'priority_apply', 'apply_order', 'is_admin'] + _table_name = 'modules' def persisted_models(): -- cgit v1.2.1