mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 09:27:36 -02:30
Fix up some issues with supporting schema migration
This commit is contained in:
@@ -3,11 +3,16 @@
|
|||||||
|
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
class ActivityStream(models.Model):
|
class ActivityStream(models.Model):
|
||||||
'''
|
'''
|
||||||
Model used to describe activity stream (audit) events
|
Model used to describe activity stream (audit) events
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
app_label = 'main'
|
||||||
|
|
||||||
OPERATION_CHOICES = [
|
OPERATION_CHOICES = [
|
||||||
('create', _('Entity Created')),
|
('create', _('Entity Created')),
|
||||||
('update', _("Entity Updated")),
|
('update', _("Entity Updated")),
|
||||||
@@ -16,7 +21,7 @@ class ActivityStream(models.Model):
|
|||||||
('disaassociate', _("Entity was Disassociated with another Entity"))
|
('disaassociate', _("Entity was Disassociated with another Entity"))
|
||||||
]
|
]
|
||||||
|
|
||||||
user = models.ForeignKey('auth.User', null=True, on_delete=models.SET_NULL)
|
user = models.ForeignKey('auth.User', null=True, on_delete=models.SET_NULL, related_name='activity_stream')
|
||||||
operation = models.CharField(max_length=9, choices=OPERATION_CHOICES)
|
operation = models.CharField(max_length=9, choices=OPERATION_CHOICES)
|
||||||
timestamp = models.DateTimeField(auto_now_add=True)
|
timestamp = models.DateTimeField(auto_now_add=True)
|
||||||
changes = models.TextField(blank=True)
|
changes = models.TextField(blank=True)
|
||||||
@@ -24,7 +29,7 @@ class ActivityStream(models.Model):
|
|||||||
object1_id = models.PositiveIntegerField(db_index=True)
|
object1_id = models.PositiveIntegerField(db_index=True)
|
||||||
object1_type = models.TextField()
|
object1_type = models.TextField()
|
||||||
|
|
||||||
object2_id = models.PositiveIntegerField(db_index=True)
|
object2_id = models.PositiveIntegerField(db_index=True, null=True)
|
||||||
object2_type = models.TextField()
|
object2_type = models.TextField(null=True, blank=True)
|
||||||
|
|
||||||
object_relationship_type = models.TextField()
|
object_relationship_type = models.TextField(blank=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user