From 74cb93fca8e62fc65eb2a9f04c691f6732505d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20Fran=C3=A7oise?= Date: Fri, 18 Nov 2016 14:16:32 +0100 Subject: [PATCH] Removed nullable flag from audit_id in ActionPlan Partially Implements: blueprint watcher-versioned-objects Change-Id: I0bf572e0756ef5d9bb73711a28225526dd044995 --- watcher/objects/action_plan.py | 5 +++-- watcher/tests/objects/test_objects.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/watcher/objects/action_plan.py b/watcher/objects/action_plan.py index 32ab254ae..977f3e079 100644 --- a/watcher/objects/action_plan.py +++ b/watcher/objects/action_plan.py @@ -93,14 +93,15 @@ class ActionPlan(base.WatcherPersistentObject, base.WatcherObject, # Version 1.0: Initial version # Version 1.1: Added 'audit' and 'strategy' object field - VERSION = '1.1' + # Version 1.2: audit_id is not nullable anymore + VERSION = '1.2' dbapi = db_api.get_instance() fields = { 'id': wfields.IntegerField(), 'uuid': wfields.UUIDField(), - 'audit_id': wfields.IntegerField(nullable=True), + 'audit_id': wfields.IntegerField(), 'strategy_id': wfields.IntegerField(), 'first_action_id': wfields.IntegerField(nullable=True), 'state': wfields.StringField(nullable=True), diff --git a/watcher/tests/objects/test_objects.py b/watcher/tests/objects/test_objects.py index 3c1c807d9..29dc05859 100644 --- a/watcher/tests/objects/test_objects.py +++ b/watcher/tests/objects/test_objects.py @@ -413,7 +413,7 @@ expected_object_fingerprints = { 'Strategy': '1.1-73f164491bdd4c034f48083a51bdeb7b', 'AuditTemplate': '1.1-b291973ffc5efa2c61b24fe34fdccc0b', 'Audit': '1.1-dc246337c8d511646cb537144fcb0f3a', - 'ActionPlan': '1.1-299bd9c76f2402a0b2167f8e4d744a05', + 'ActionPlan': '1.2-42709eadf6b2bd228ea87817e8c3e31e', 'Action': '1.1-52c77e4db4ce0aa9480c9760faec61a1', 'EfficacyIndicator': '1.0-655b71234a82bc7478aff964639c4bb0', 'ScoringEngine': '1.0-4abbe833544000728e17bd9e83f97576',