# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
#   * Rearrange models' order
#   * Make sure each model has one field with primary_key=True
#   * Remove `managed = False` lines if you wish to allow Django to create and delete the table
# Feel free to rename the models, but don't rename db_table values or field names.
#
# Also note: You'll have to insert the output of 'django-admin.py sqlcustom [appname]'
# into your database.
from __future__ import unicode_literals

from django.db import models

class Client(models.Model):
    client_id = models.BigIntegerField(unique=True)
    client_handle = models.CharField(unique=True, max_length=255)
    base_uri = models.TextField(blank=True)
    bpki_cert = models.TextField(blank=True)
    bpki_glue = models.TextField(blank=True)
    last_cms_timestamp = models.DateTimeField(blank=True, null=True)
    class Meta:
        managed = False
        db_table = 'client'

class Delta(models.Model):
    delta_id = models.BigIntegerField(unique=True)
    serial = models.BigIntegerField()
    xml = models.TextField()
    hash = models.CharField(max_length=64)
    expires = models.DateTimeField()
    session = models.ForeignKey('Session')
    class Meta:
        managed = False
        db_table = 'delta'

class Object(models.Model):
    object_id = models.BigIntegerField(unique=True)
    uri = models.CharField(max_length=255)
    der = models.TextField()
    hash = models.CharField(max_length=64)
    client = models.ForeignKey(Client)
    session = models.ForeignKey('Session')
    class Meta:
        managed = False
        db_table = 'object'

class Session(models.Model):
    session_id = models.BigIntegerField(unique=True)
    uuid = models.CharField(unique=True, max_length=36)
    serial = models.BigIntegerField()
    snapshot = models.TextField(blank=True)
    hash = models.CharField(max_length=64, blank=True)
    class Meta:
        managed = False
        db_table = 'session'

