예제 #1
0
"""
.. module: lemur.models
    :platform: Unix
    :synopsis: This module contains all of the associative tables
    that help define the many to many relationships established in Lemur

    :copyright: (c) 2015 by Netflix Inc., see AUTHORS for more
    :license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson <*****@*****.**>
"""
from sqlalchemy import Column, Integer, ForeignKey, Index, UniqueConstraint

from lemur.database import db

certificate_associations = db.Table(
    'certificate_associations',
    Column('domain_id', Integer, ForeignKey('domains.id')),
    Column('certificate_id', Integer, ForeignKey('certificates.id')))

Index('certificate_associations_ix', certificate_associations.c.domain_id,
      certificate_associations.c.certificate_id)

certificate_destination_associations = db.Table(
    'certificate_destination_associations',
    Column('destination_id', Integer,
           ForeignKey('destinations.id', ondelete='cascade')),
    Column('certificate_id', Integer,
           ForeignKey('certificates.id', ondelete='cascade')))

Index('certificate_destination_associations_ix',
      certificate_destination_associations.c.destination_id,
      certificate_destination_associations.c.certificate_id)
예제 #2
0
    :synopsis: This module contains all of the associative tables
    that help define the many to many relationships established in Lemur

    :copyright: (c) 2018 by Netflix Inc., see AUTHORS for more
    :license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson <*****@*****.**>
"""
from sqlalchemy import Column, Integer, ForeignKey, Index, UniqueConstraint

from lemur.database import db

certificate_destination_associations = db.Table(
    "certificate_destination_associations",
    Column(
        "destination_id", Integer, ForeignKey("destinations.id", ondelete="cascade")
    ),
    Column(
        "certificate_id", Integer, ForeignKey("certificates.id", ondelete="cascade")
    ),
)

Index(
    "certificate_destination_associations_ix",
    certificate_destination_associations.c.destination_id,
    certificate_destination_associations.c.certificate_id,
)

certificate_source_associations = db.Table(
    "certificate_source_associations",
    Column("source_id", Integer, ForeignKey("sources.id", ondelete="cascade")),
    Column(
예제 #3
0
파일: models.py 프로젝트: rtdean/lemur
"""
.. module: lemur.models
    :platform: Unix
    :synopsis: This module contains all of the associative tables
    that help define the many to many relationships established in Lemur

    :copyright: (c) 2015 by Netflix Inc., see AUTHORS for more
    :license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson <*****@*****.**>
"""
from sqlalchemy import Column, Integer, ForeignKey
from lemur.database import db

certificate_associations = db.Table('certificate_associations',
                                    Column('domain_id', Integer, ForeignKey('domains.id')),
                                    Column('certificate_id', Integer, ForeignKey('certificates.id'))
                                    )

certificate_destination_associations = db.Table('certificate_destination_associations',
                                                Column('destination_id', Integer,
                                                       ForeignKey('destinations.id', ondelete='cascade')),
                                                Column('certificate_id', Integer,
                                                       ForeignKey('certificates.id', ondelete='cascade'))
                                                )

certificate_source_associations = db.Table('certificate_source_associations',
                                           Column('source_id', Integer,
                                                  ForeignKey('sources.id', ondelete='cascade')),
                                           Column('certificate_id', Integer,
                                                  ForeignKey('certificates.id', ondelete='cascade'))
                                           )