Skip to content

[bug] NetworkField does not work with MySQL/MariaDB  #146

Description

@pandafy

Running migrations on MySQL (Server version: 8.0.31 MySQL Community Server - GPL) raises following error

django.db.utils.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cidr NOT NULL, `description` varchar(100) NOT NULL, `master_subnet_id` char(32) ' at line 1")

The CIDR data type is also not supported on MariaDB.

class NetworkField(models.Field):
empty_strings_allowed = False
description = 'CIDR type network field'
def __init__(self, *args, **kwargs):
kwargs['max_length'] = 43
super().__init__(*args, **kwargs)
def db_type(self, connection):
return 'cidr'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions