<commit_before># Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
from sqlalchemy import (
    CheckConstraint, Column, Integer, ForeignKey, String, between, event)
from sqlalchemy.orm import relationship, backref
from sqlalchemy.schema import AddConstraint
from pycroft.model.base import ModelBase
from pycroft.model.types import IPAddress, IPNetwork


class VLAN(ModelBase):
    name = Column(String(127), nullable=False)
    vid = Column(Integer, nullable=False)

    __table_args = (
        CheckConstraint(between(vid, 1, 4094)),
    )


class Subnet(ModelBase):
    address = Column(IPNetwork, nullable=False)
    gateway = Column(IPAddress)
    primary_dns_zone_id = Column(Integer, ForeignKey("dns_zone.id"),
                                 nullable=False)
    primary_dns_zone = relationship("DNSZone", foreign_keys=[primary_dns_zone_id])
    reverse_dns_zone_id = Column(Integer, ForeignKey("dns_zone.id"),
                                 nullable=False)
    reverse_dns_zone = relationship("DNSZone", foreign_keys=[reverse_dns_zone_id])
    reserved_addresses = Column(Integer, default=0, nullable=False)
    description = Column(String(50))
<commit_msg>Make reverse_dns_zone_id nullable for now<commit_after># Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
from sqlalchemy import (
    CheckConstraint, Column, Integer, ForeignKey, String, between, event)
from sqlalchemy.orm import relationship, backref
from sqlalchemy.schema import AddConstraint
from pycroft.model.base import ModelBase
from pycroft.model.types import IPAddress, IPNetwork


class VLAN(ModelBase):
    name = Column(String(127), nullable=False)
    vid = Column(Integer, nullable=False)

    __table_args = (
        CheckConstraint(between(vid, 1, 4094)),
    )


class Subnet(ModelBase):
    address = Column(IPNetwork, nullable=False)
    gateway = Column(IPAddress)
    primary_dns_zone_id = Column(Integer, ForeignKey("dns_zone.id"),
                                 nullable=False)
    primary_dns_zone = relationship("DNSZone", foreign_keys=[primary_dns_zone_id])
    reverse_dns_zone_id = Column(Integer, ForeignKey("dns_zone.id"),
                                 nullable=True)
    reverse_dns_zone = relationship("DNSZone", foreign_keys=[reverse_dns_zone_id])
    reserved_addresses = Column(Integer, default=0, nullable=False)
    description = Column(String(50))

{'fraction_non_alphanumeric': 0.08815838625326858, 'fraction_numerical': 0.01270078446021666, 'mean_word_length': 4.043314500941619, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4471561', 'n_tokens_mistral': 817, 'n_tokens_neox': 772, 'n_words': 210}