Disable unique constraints
Change-Id: I894f7654b776bb430664b2cfd600696ab0fcb1dc
This commit is contained in:
parent
a09e815888
commit
2e3a5d6a6b
@ -17,6 +17,6 @@ import mongoengine
|
|||||||
|
|
||||||
class BusinessImpactModulation(mongoengine.Document):
|
class BusinessImpactModulation(mongoengine.Document):
|
||||||
meta = {'collection': 'businessimpactmodulations'}
|
meta = {'collection': 'businessimpactmodulations'}
|
||||||
business_impact_modulation_name = mongoengine.StringField(unique=True)
|
business_impact_modulation_name = mongoengine.StringField()
|
||||||
business_impact = mongoengine.IntField()
|
business_impact = mongoengine.IntField()
|
||||||
modulation_period = mongoengine.StringField()
|
modulation_period = mongoengine.StringField()
|
@ -17,6 +17,6 @@ import mongoengine
|
|||||||
|
|
||||||
class CheckModulation(mongoengine.Document):
|
class CheckModulation(mongoengine.Document):
|
||||||
meta = {'collection': 'checkmodulations'}
|
meta = {'collection': 'checkmodulations'}
|
||||||
checkmodulation_name = mongoengine.StringField(unique=True)
|
checkmodulation_name = mongoengine.StringField()
|
||||||
check_command = mongoengine.StringField()
|
check_command = mongoengine.StringField()
|
||||||
check_period = mongoengine.StringField()
|
check_period = mongoengine.StringField()
|
@ -16,7 +16,10 @@ import mongoengine
|
|||||||
|
|
||||||
|
|
||||||
class Command(mongoengine.Document):
|
class Command(mongoengine.Document):
|
||||||
meta = {'collection': 'commands'}
|
meta = {
|
||||||
command_name = mongoengine.StringField(unique=True)
|
'collection': 'commands',
|
||||||
|
'strict': False
|
||||||
|
}
|
||||||
|
command_name = mongoengine.StringField()
|
||||||
command_line = mongoengine.StringField()
|
command_line = mongoengine.StringField()
|
||||||
module_type = mongoengine.StringField()
|
module_type = mongoengine.StringField()
|
||||||
|
@ -17,7 +17,7 @@ import mongoengine
|
|||||||
|
|
||||||
class Contact(mongoengine.Document):
|
class Contact(mongoengine.Document):
|
||||||
meta = {'collection': 'contacts'}
|
meta = {'collection': 'contacts'}
|
||||||
contact_name = mongoengine.StringField(unique=True)
|
contact_name = mongoengine.StringField()
|
||||||
host_notifications_enabled = mongoengine.StringField()
|
host_notifications_enabled = mongoengine.StringField()
|
||||||
service_notifications_enabled = mongoengine.StringField()
|
service_notifications_enabled = mongoengine.StringField()
|
||||||
host_notification_period = mongoengine.StringField()
|
host_notification_period = mongoengine.StringField()
|
||||||
|
@ -17,7 +17,7 @@ import mongoengine
|
|||||||
|
|
||||||
class ContactGroup(mongoengine.Document):
|
class ContactGroup(mongoengine.Document):
|
||||||
meta = {'collection': 'contactgroups'}
|
meta = {'collection': 'contactgroups'}
|
||||||
contactgroup_name = mongoengine.StringField(unique=True)
|
contactgroup_name = mongoengine.StringField()
|
||||||
members = mongoengine.StringField()
|
members = mongoengine.StringField()
|
||||||
alias = mongoengine.StringField()
|
alias = mongoengine.StringField()
|
||||||
contactgroup_members = mongoengine.StringField()
|
contactgroup_members = mongoengine.StringField()
|
@ -16,8 +16,11 @@ import mongoengine
|
|||||||
|
|
||||||
|
|
||||||
class Host(mongoengine.Document):
|
class Host(mongoengine.Document):
|
||||||
meta = {'collection': 'hosts'}
|
meta = {
|
||||||
host_name = mongoengine.StringField(unique=True)
|
'collection': 'hosts',
|
||||||
|
'strict': False
|
||||||
|
}
|
||||||
|
host_name = mongoengine.StringField()
|
||||||
address = mongoengine.StringField()
|
address = mongoengine.StringField()
|
||||||
max_check_attempts = mongoengine.IntField()
|
max_check_attempts = mongoengine.IntField()
|
||||||
check_period = mongoengine.StringField()
|
check_period = mongoengine.StringField()
|
||||||
|
@ -17,7 +17,7 @@ import mongoengine
|
|||||||
|
|
||||||
class HostGroup(mongoengine.Document):
|
class HostGroup(mongoengine.Document):
|
||||||
meta = {'collection': 'hostgroups'}
|
meta = {'collection': 'hostgroups'}
|
||||||
hostgroup_name = mongoengine.StringField(unique=True)
|
hostgroup_name = mongoengine.StringField()
|
||||||
members = mongoengine.StringField()
|
members = mongoengine.StringField()
|
||||||
alias = mongoengine.StringField()
|
alias = mongoengine.StringField()
|
||||||
hostgroup_members = mongoengine.StringField()
|
hostgroup_members = mongoengine.StringField()
|
||||||
|
@ -17,6 +17,6 @@ import mongoengine
|
|||||||
|
|
||||||
class MacroModulation(mongoengine.Document):
|
class MacroModulation(mongoengine.Document):
|
||||||
meta = {'collection': 'macromodulations'}
|
meta = {'collection': 'macromodulations'}
|
||||||
macromodulation_name = mongoengine.StringField(unique=True)
|
macromodulation_name = mongoengine.StringField()
|
||||||
modulation_period = mongoengine.StringField()
|
modulation_period = mongoengine.StringField()
|
||||||
macros = mongoengine.DictField()
|
macros = mongoengine.DictField()
|
||||||
|
@ -17,7 +17,7 @@ import mongoengine
|
|||||||
|
|
||||||
class NotificationWays(mongoengine.Document):
|
class NotificationWays(mongoengine.Document):
|
||||||
meta = {'collection': 'notificationways'}
|
meta = {'collection': 'notificationways'}
|
||||||
notificationway_name = mongoengine.StringField(unique=True)
|
notificationway_name = mongoengine.StringField()
|
||||||
host_notification_period = mongoengine.StringField()
|
host_notification_period = mongoengine.StringField()
|
||||||
service_notification_period = mongoengine.StringField()
|
service_notification_period = mongoengine.StringField()
|
||||||
host_notification_options = mongoengine.StringField()
|
host_notification_options = mongoengine.StringField()
|
||||||
|
@ -17,6 +17,6 @@ import mongoengine
|
|||||||
|
|
||||||
class Realm(mongoengine.Document):
|
class Realm(mongoengine.Document):
|
||||||
meta = {'collection': 'realms'}
|
meta = {'collection': 'realms'}
|
||||||
realm_name = mongoengine.StringField(unique=True)
|
realm_name = mongoengine.StringField()
|
||||||
realm_members = mongoengine.StringField()
|
realm_members = mongoengine.StringField()
|
||||||
default = mongoengine.IntField()
|
default = mongoengine.IntField()
|
@ -16,8 +16,11 @@ import mongoengine
|
|||||||
|
|
||||||
|
|
||||||
class Service(mongoengine.Document):
|
class Service(mongoengine.Document):
|
||||||
meta = {'collection': 'services'}
|
meta = {
|
||||||
host_name = mongoengine.StringField(unique=True)
|
'collection': 'services',
|
||||||
|
'strict': False
|
||||||
|
}
|
||||||
|
host_name = mongoengine.StringField()
|
||||||
service_description = mongoengine.StringField()
|
service_description = mongoengine.StringField()
|
||||||
contacts = mongoengine.StringField()
|
contacts = mongoengine.StringField()
|
||||||
check_command = mongoengine.StringField()
|
check_command = mongoengine.StringField()
|
||||||
|
@ -17,7 +17,7 @@ import mongoengine
|
|||||||
|
|
||||||
class ServiceGroup(mongoengine.Document):
|
class ServiceGroup(mongoengine.Document):
|
||||||
meta = {'collection': 'servicegroups'}
|
meta = {'collection': 'servicegroups'}
|
||||||
servicegroup_name = mongoengine.StringField(unique=True)
|
servicegroup_name = mongoengine.StringField()
|
||||||
members = mongoengine.StringField()
|
members = mongoengine.StringField()
|
||||||
alias = mongoengine.StringField()
|
alias = mongoengine.StringField()
|
||||||
servicegroup_members = mongoengine.StringField()
|
servicegroup_members = mongoengine.StringField()
|
||||||
|
@ -17,6 +17,6 @@ import mongoengine
|
|||||||
|
|
||||||
class TimePeriod(mongoengine.Document):
|
class TimePeriod(mongoengine.Document):
|
||||||
meta = {'collection': 'timeperiods'}
|
meta = {'collection': 'timeperiods'}
|
||||||
timeperiod_name = mongoengine.StringField(unique=True)
|
timeperiod_name = mongoengine.StringField()
|
||||||
exclude = mongoengine.StringField()
|
exclude = mongoengine.StringField()
|
||||||
periods = mongoengine.DictField()
|
periods = mongoengine.DictField()
|
||||||
|
@ -101,7 +101,7 @@ class TestMacroModulationController(functionalTest.FunctionalTest):
|
|||||||
|
|
||||||
self.assertIsNotNone(
|
self.assertIsNotNone(
|
||||||
self.mongoconnection.shinken.macromodulations.find_one(
|
self.mongoconnection.shinken.macromodulations.find_one(
|
||||||
m
|
{'macromodulation_name': 'TEST_CREATE_MODULATION'}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user