# 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 Bsc(models.Model):
    bsc_id = models.BigIntegerField(unique=True)
    bsc_handle = models.CharField(max_length=255)
    private_key_id = models.TextField(blank=True)
    pkcs10_request = models.TextField(blank=True)
    hash_alg = models.CharField(max_length=6, blank=True)
    signing_cert = models.TextField(blank=True)
    signing_cert_crl = models.TextField(blank=True)
    self = models.ForeignKey('Self')
    class Meta:
        managed = False
        db_table = 'bsc'

class Ca(models.Model):
    ca_id = models.BigIntegerField(unique=True)
    last_crl_sn = models.BigIntegerField()
    last_manifest_sn = models.BigIntegerField()
    next_manifest_update = models.DateTimeField(blank=True, null=True)
    next_crl_update = models.DateTimeField(blank=True, null=True)
    last_issued_sn = models.BigIntegerField()
    sia_uri = models.TextField(blank=True)
    parent_resource_class = models.TextField(blank=True)
    parent = models.ForeignKey('Parent')
    class Meta:
        managed = False
        db_table = 'ca'

class CaDetail(models.Model):
    ca_detail_id = models.BigIntegerField(unique=True)
    public_key = models.TextField(blank=True)
    private_key_id = models.TextField(blank=True)
    latest_crl = models.TextField(blank=True)
    crl_published = models.DateTimeField(blank=True, null=True)
    latest_ca_cert = models.TextField(blank=True)
    manifest_private_key_id = models.TextField(blank=True)
    manifest_public_key = models.TextField(blank=True)
    latest_manifest_cert = models.TextField(blank=True)
    latest_manifest = models.TextField(blank=True)
    manifest_published = models.DateTimeField(blank=True, null=True)
    state = models.CharField(max_length=10)
    ca_cert_uri = models.TextField(blank=True)
    ca = models.ForeignKey(Ca)
    class Meta:
        managed = False
        db_table = 'ca_detail'

class Child(models.Model):
    child_id = models.BigIntegerField(unique=True)
    child_handle = models.CharField(max_length=255)
    bpki_cert = models.TextField(blank=True)
    bpki_glue = models.TextField(blank=True)
    last_cms_timestamp = models.DateTimeField(blank=True, null=True)
    self = models.ForeignKey('Self')
    bsc = models.ForeignKey(Bsc)
    class Meta:
        managed = False
        db_table = 'child'

class ChildCert(models.Model):
    child_cert_id = models.BigIntegerField(unique=True)
    cert = models.TextField()
    published = models.DateTimeField(blank=True, null=True)
    ski = models.TextField()
    child = models.ForeignKey(Child)
    ca_detail = models.ForeignKey(CaDetail)
    class Meta:
        managed = False
        db_table = 'child_cert'

class EeCert(models.Model):
    ee_cert_id = models.BigIntegerField(unique=True)
    ski = models.CharField(max_length=20)
    cert = models.TextField()
    published = models.DateTimeField(blank=True, null=True)
    self = models.ForeignKey('Self')
    ca_detail = models.ForeignKey(CaDetail)
    class Meta:
        managed = False
        db_table = 'ee_cert'

class Ghostbuster(models.Model):
    ghostbuster_id = models.BigIntegerField(unique=True)
    vcard = models.TextField()
    cert = models.TextField()
    ghostbuster = models.TextField()
    published = models.DateTimeField(blank=True, null=True)
    self = models.ForeignKey('Self')
    ca_detail = models.ForeignKey(CaDetail)
    class Meta:
        managed = False
        db_table = 'ghostbuster'

class Parent(models.Model):
    parent_id = models.BigIntegerField(unique=True)
    parent_handle = models.CharField(max_length=255)
    bpki_cms_cert = models.TextField(blank=True)
    bpki_cms_glue = models.TextField(blank=True)
    peer_contact_uri = models.TextField(blank=True)
    sia_base = models.TextField(blank=True)
    sender_name = models.TextField(blank=True)
    recipient_name = models.TextField(blank=True)
    last_cms_timestamp = models.DateTimeField(blank=True, null=True)
    self = models.ForeignKey('Self')
    bsc = models.ForeignKey(Bsc)
    repository = models.ForeignKey('Repository')
    class Meta:
        managed = False
        db_table = 'parent'

class Repository(models.Model):
    repository_id = models.BigIntegerField(unique=True)
    repository_handle = models.CharField(max_length=255)
    peer_contact_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)
    bsc = models.ForeignKey(Bsc)
    self = models.ForeignKey('Self')
    class Meta:
        managed = False
        db_table = 'repository'

class RevokedCert(models.Model):
    revoked_cert_id = models.BigIntegerField(unique=True)
    serial = models.BigIntegerField()
    revoked = models.DateTimeField()
    expires = models.DateTimeField()
    ca_detail = models.ForeignKey(CaDetail)
    class Meta:
        managed = False
        db_table = 'revoked_cert'

class Roa(models.Model):
    roa_id = models.BigIntegerField(unique=True)
    asn = models.BigIntegerField()
    cert = models.TextField()
    roa = models.TextField()
    published = models.DateTimeField(blank=True, null=True)
    self = models.ForeignKey('Self')
    ca_detail = models.ForeignKey(CaDetail)
    class Meta:
        managed = False
        db_table = 'roa'

class RoaPrefix(models.Model):
    prefix = models.CharField(max_length=40)
    prefixlen = models.IntegerField()
    max_prefixlen = models.IntegerField()
    version = models.IntegerField()
    roa = models.ForeignKey(Roa)
    class Meta:
        managed = False
        db_table = 'roa_prefix'

class Self(models.Model):
    self_id = models.BigIntegerField(unique=True)
    self_handle = models.CharField(unique=True, max_length=255)
    use_hsm = models.IntegerField()
    crl_interval = models.BigIntegerField(blank=True, null=True)
    regen_margin = models.BigIntegerField(blank=True, null=True)
    bpki_cert = models.TextField(blank=True)
    bpki_glue = models.TextField(blank=True)
    class Meta:
        managed = False
        db_table = 'self'

