Files
coulobre/src/coulobre/hosting/migrations/0006_hostingdatabase.py
T

60 lines
2.0 KiB
Python

# Generated by Django 5.2.19 on 2026-11-19 21:37
import django.core.validators
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("hosting", "0005_reseller_account_limit_reseller_hosting_plans"),
]
operations = [
migrations.CreateModel(
name="HostingDatabase",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"suffix",
models.CharField(
help_text="Use 1 to 24 lowercase letters, digits, or underscores. Start with a letter.",
max_length=24,
validators=[
django.core.validators.RegexValidator(
"\\A[a-z][a-z0-9_]{0,23}\\Z",
"Use 1 to 24 lowercase letters, digits, or underscores. Start with a letter.",
)
],
verbose_name="database suffix",
),
),
(
"account",
models.ForeignKey(
on_delete=django.db.models.deletion.PROTECT,
related_name="databases",
to="hosting.hostingaccount",
),
),
],
options={
"ordering": ("suffix",),
"constraints": [
models.UniqueConstraint(
fields=("account", "suffix"),
name="hosting_database_account_suffix_unique",
)
],
},
),
]