class ThreadPrunedEvent(models.Model): id = UUIDField(primary_key=True, default=Utils.CreateSequentialUUIDForDB, null=False) timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB, null=False) threadID = UUIDField(default=None, null=False) class Meta: db_table = Const.Database.TableNames.Logging.THREAD_PRUNED
class ModAction(models.Model): id = UUIDField(primary_key=True, default=Utils.CreateSequentialUUIDForDB, null=False) timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB, null=False) result = models.CharField(default=None, null=False, max_length=3) contentID = UUIDField(default=None, null=False) contentType = models.CharField( default=None, null=False, max_length=Const.Database.MaxLengths.CONTENT_TYPE) class Meta: db_table = Const.Database.TableNames.Moderation.MOD_ACTION
class OnlineContent(models.Model): id = UUIDField(primary_key=True, default=Utils.CreateSequentialUUIDForDB, null=False) timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB, null=False) fromUser = models.ForeignKey(User, related_name='+', default=None, null=False) fromSession = models.ForeignKey(Session, related_name='+', default=None, null=False) key = models.CharField(default=None, null=True, max_length=Const.Database.MaxLengths.S3_KEY) contentType = models.CharField( default=None, null=False, max_length=Const.Database.MaxLengths.CONTENT_TYPE) fav = models.BooleanField(default=False, null=False) class Meta: db_table = Const.Database.TableNames.Content.ONLINE
class Hit(models.Model): id = UUIDField(primary_key=True, default=Utils.CreateSequentialUUIDForDB, null=False) timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB, null=False) url = models.CharField( default=None, null=False, max_length=Const.Database.MaxLengths.Security.ERROR_REQUESTED_URL) responseCode = models.SmallIntegerField(default=None, null=True) messageCode = models.CharField( default=None, null=True, max_length=Const.Database.MaxLengths.MESSAGE_CODE) ip = models.GenericIPAddressField(default=None, null=False) fromUser = models.ForeignKey(User, related_name='+', default=None, null=True) session = models.ForeignKey(Session, related_name='+', default=None, null=True) class Meta: db_table = Const.Database.TableNames.Security.HIT
class NotificationSentEvent(models.Model): id = UUIDField(primary_key=True, default=Utils.CreateSequentialUUIDForDB, null=False) timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB, null=False) messageCode = models.CharField( default=None, null=False, max_length=Const.Database.MaxLengths.MESSAGE_CODE) deliveryType = models.CharField(default=None, null=False, max_length=Const.Database.MaxLengths. Logging.NOTIFICATION_DELIVERY_TYPE) notificationType = models.CharField( default=None, null=False, max_length=Const.Database.MaxLengths.Logging.NOTIFICATION_TYPE) numCollapsedNotifcations = models.IntegerField( default=None, null=False ) # how many 'notifications' are bundled into this one (many server errors sent in one email, for ex) class Meta: db_table = Const.Database.TableNames.Logging.NOTIFICATION_SENT
class User(models.Model): id = UUIDField(primary_key=True, default=Utils.CreateSequentialUUIDForDB, null=False) timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB, null=False) # denormalized field timeLastLogin = models.IntegerField(default=None, null=True) class Meta: db_table = Const.Database.TableNames.Security.USER
class Report(models.Model): id = UUIDField(primary_key=True, default=Utils.CreateSequentialUUIDForDB, null=False) timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB, null=False) fromUser = models.ForeignKey(User, related_name='+', default=None, null=False) contentID = UUIDField(default=None, null=False) modAction = models.ForeignKey(ModAction, related_name='+', default=None, null=True) contentType = models.CharField( default=None, null=False, max_length=Const.Database.MaxLengths.CONTENT_TYPE) class Meta: db_table = Const.Database.TableNames.Moderation.REPORT
class Ban(models.Model): id = UUIDField(primary_key=True, default=Utils.CreateSequentialUUIDForDB, null=False) timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB, null=False) timeBanExpires = models.IntegerField(default=None, null=False) bannedUser = models.ForeignKey(User, related_name='+', default=None, null=False) class Meta: db_table = Const.Database.TableNames.Moderation.BAN
class StaticContentPrunedEvent(models.Model): id = UUIDField(primary_key=True, default=Utils.CreateSequentialUUIDForDB, null=False) timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB, null=False) messageCode = models.CharField( default=None, null=False, max_length=Const.Database.MaxLengths.MESSAGE_CODE) numRequestedForDeleteion = models.IntegerField(default=None, null=False) numDeleted = models.IntegerField(default=None, null=False) class Meta: db_table = Const.Database.TableNames.Logging.STATIC_CONTENT_PRUNED
class LocalPostsPrunedEvent(models.Model): id = UUIDField(primary_key=True, default=Utils.CreateSequentialUUIDForDB, null=False) timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB, null=False) messageCode = models.CharField( default=None, null=False, max_length=Const.Database.MaxLengths.MESSAGE_CODE) numOldPosts = models.IntegerField(default=None, null=False) numDeletedPosts = models.IntegerField(default=None, null=False) class Meta: db_table = Const.Database.TableNames.Logging.LOCALPOSTS_PRUNED
class Error(models.Model): id = UUIDField(primary_key=True, default=Utils.CreateSequentialUUIDForDB, null=False) timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB, null=False) file = models.CharField( max_length=Const.Database.MaxLengths.Logging.SERVER_ERROR_FILENAME, default=None, null=False) lineNum = models.IntegerField(default=None, null=False) exeptionMessage = models.TextField(default=None, null=False) stackTrace = models.TextField(default=None, null=False) class Meta: db_table = Const.Database.TableNames.Logging.ERROR
class Feedback(models.Model): id = UUIDField(primary_key=True, default=Utils.CreateSequentialUUIDForDB, null=False) timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB, null=False) fromUser = models.ForeignKey(User, related_name='+', default=None, null=False) text = models.CharField( default=None, null=False, max_length=Const.Database.MaxLengths.Analytics.FEEDBACK) class Meta: db_table = Const.Database.TableNames.Analytics.FEEDBACK
class Session(models.Model): id = UUIDField(primary_key=True, default=Utils.CreateSequentialUUIDForDB, null=False) timeCreated = models.IntegerField(default=Utils.CreateTimestampForDB, null=False) timeExpires = models.IntegerField(default=None, null=False) token = models.CharField( default=None, null=False, max_length=Const.Database.MaxLengths.Security.SESSION_TOKEN) fromUser = models.ForeignKey(User, related_name='+', default=None, null=False) class Meta: db_table = Const.Database.TableNames.Security.SESSION