2015-01-18 13:22:06 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
import django.utils.timezone
|
|
|
|
import model_utils.fields
|
2018-11-19 23:28:40 +01:00
|
|
|
from django.conf import settings
|
|
|
|
from django.db import migrations, models
|
2015-01-18 13:22:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='CustomerHostingPackage',
|
|
|
|
fields=[
|
2018-11-19 23:28:40 +01:00
|
|
|
('id', models.AutoField(
|
|
|
|
verbose_name='ID', serialize=False, auto_created=True,
|
|
|
|
primary_key=True)),
|
|
|
|
('created', model_utils.fields.AutoCreatedField(
|
|
|
|
default=django.utils.timezone.now, verbose_name='created',
|
|
|
|
editable=False)),
|
|
|
|
('modified', model_utils.fields.AutoLastModifiedField(
|
|
|
|
default=django.utils.timezone.now, verbose_name='modified',
|
|
|
|
editable=False)),
|
|
|
|
('name', models.CharField(
|
|
|
|
unique=True, max_length=128, verbose_name='name')),
|
|
|
|
('description', models.TextField(
|
|
|
|
verbose_name='description', blank=True)),
|
|
|
|
('mailboxcount', models.PositiveIntegerField(
|
|
|
|
verbose_name='mailbox count')),
|
|
|
|
('diskspace', models.PositiveIntegerField(
|
|
|
|
help_text='disk space for the hosting package',
|
|
|
|
verbose_name='disk space')),
|
|
|
|
('diskspace_unit', models.PositiveSmallIntegerField(
|
|
|
|
verbose_name='unit of disk space',
|
|
|
|
choices=[(0, 'MiB'), (1, 'GiB'), (2, 'TiB')])),
|
|
|
|
('customer', models.ForeignKey(
|
|
|
|
verbose_name='customer', to=settings.AUTH_USER_MODEL,
|
|
|
|
on_delete=models.CASCADE)),
|
2015-01-18 13:22:06 +01:00
|
|
|
],
|
|
|
|
options={
|
|
|
|
'verbose_name': 'customer hosting package',
|
|
|
|
'verbose_name_plural': 'customer hosting packages',
|
|
|
|
},
|
|
|
|
bases=(models.Model,),
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='CustomerHostingPackageOption',
|
|
|
|
fields=[
|
2018-11-19 23:28:40 +01:00
|
|
|
('id', models.AutoField(
|
|
|
|
verbose_name='ID', serialize=False, auto_created=True,
|
|
|
|
primary_key=True)),
|
|
|
|
('created', model_utils.fields.AutoCreatedField(
|
|
|
|
default=django.utils.timezone.now, verbose_name='created',
|
|
|
|
editable=False)),
|
|
|
|
('modified', model_utils.fields.AutoLastModifiedField(
|
|
|
|
default=django.utils.timezone.now, verbose_name='modified',
|
|
|
|
editable=False)),
|
2015-01-18 13:22:06 +01:00
|
|
|
],
|
|
|
|
options={
|
|
|
|
'verbose_name': 'customer hosting option',
|
|
|
|
'verbose_name_plural': 'customer hosting options',
|
|
|
|
},
|
|
|
|
bases=(models.Model,),
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='CustomerDiskSpaceOption',
|
|
|
|
fields=[
|
2018-11-19 23:28:40 +01:00
|
|
|
('customerhostingpackageoption_ptr', models.OneToOneField(
|
|
|
|
parent_link=True, auto_created=True, primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
to='hostingpackages.CustomerHostingPackageOption',
|
|
|
|
on_delete=models.CASCADE)),
|
|
|
|
('diskspace', models.PositiveIntegerField(
|
|
|
|
verbose_name='disk space')),
|
|
|
|
('diskspace_unit', models.PositiveSmallIntegerField(
|
|
|
|
verbose_name='unit of disk space',
|
|
|
|
choices=[(0, 'MiB'), (1, 'GiB'), (2, 'TiB')])),
|
2015-01-18 13:22:06 +01:00
|
|
|
],
|
|
|
|
options={
|
|
|
|
'ordering': ['diskspace_unit', 'diskspace'],
|
|
|
|
'abstract': False,
|
|
|
|
'verbose_name': 'Disk space option',
|
|
|
|
'verbose_name_plural': 'Disk space options',
|
|
|
|
},
|
2018-11-19 23:28:40 +01:00
|
|
|
bases=(
|
|
|
|
'hostingpackages.customerhostingpackageoption', models.Model),
|
2015-01-18 13:22:06 +01:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='CustomerMailboxOption',
|
|
|
|
fields=[
|
2018-11-19 23:28:40 +01:00
|
|
|
('customerhostingpackageoption_ptr', models.OneToOneField(
|
|
|
|
parent_link=True, auto_created=True, primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
to='hostingpackages.CustomerHostingPackageOption',
|
|
|
|
on_delete=models.CASCADE)),
|
|
|
|
('number', models.PositiveIntegerField(
|
|
|
|
unique=True, verbose_name='number of mailboxes')),
|
2015-01-18 13:22:06 +01:00
|
|
|
],
|
|
|
|
options={
|
|
|
|
'ordering': ['number'],
|
|
|
|
'abstract': False,
|
|
|
|
'verbose_name': 'Mailbox option',
|
|
|
|
'verbose_name_plural': 'Mailbox options',
|
|
|
|
},
|
2018-11-19 23:28:40 +01:00
|
|
|
bases=(
|
|
|
|
'hostingpackages.customerhostingpackageoption', models.Model),
|
2015-01-18 13:22:06 +01:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='CustomerUserDatabaseOption',
|
|
|
|
fields=[
|
2018-11-19 23:28:40 +01:00
|
|
|
('customerhostingpackageoption_ptr', models.OneToOneField(
|
|
|
|
parent_link=True, auto_created=True, primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
to='hostingpackages.CustomerHostingPackageOption',
|
|
|
|
on_delete=models.CASCADE)),
|
|
|
|
('number', models.PositiveIntegerField(
|
|
|
|
default=1, verbose_name='number of databases')),
|
|
|
|
('db_type', models.PositiveSmallIntegerField(
|
|
|
|
verbose_name='database type',
|
|
|
|
choices=[(0, 'PostgreSQL'), (1, 'MySQL')])),
|
2015-01-18 13:22:06 +01:00
|
|
|
],
|
|
|
|
options={
|
|
|
|
'ordering': ['db_type', 'number'],
|
|
|
|
'abstract': False,
|
|
|
|
'verbose_name': 'Database option',
|
|
|
|
'verbose_name_plural': 'Database options',
|
|
|
|
},
|
2018-11-19 23:28:40 +01:00
|
|
|
bases=(
|
|
|
|
'hostingpackages.customerhostingpackageoption', models.Model),
|
2015-01-18 13:22:06 +01:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='HostingOption',
|
|
|
|
fields=[
|
2018-11-19 23:28:40 +01:00
|
|
|
('id', models.AutoField(
|
|
|
|
verbose_name='ID', serialize=False, auto_created=True,
|
|
|
|
primary_key=True)),
|
|
|
|
('created', model_utils.fields.AutoCreatedField(
|
|
|
|
default=django.utils.timezone.now, verbose_name='created',
|
|
|
|
editable=False)),
|
|
|
|
('modified', model_utils.fields.AutoLastModifiedField(
|
|
|
|
default=django.utils.timezone.now, verbose_name='modified',
|
|
|
|
editable=False)),
|
2015-01-18 13:22:06 +01:00
|
|
|
],
|
|
|
|
options={
|
|
|
|
'verbose_name': 'Hosting option',
|
|
|
|
'verbose_name_plural': 'Hosting options',
|
|
|
|
},
|
|
|
|
bases=(models.Model,),
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='DiskSpaceOption',
|
|
|
|
fields=[
|
2018-11-19 23:28:40 +01:00
|
|
|
('hostingoption_ptr', models.OneToOneField(
|
|
|
|
parent_link=True, auto_created=True, primary_key=True,
|
|
|
|
serialize=False, to='hostingpackages.HostingOption',
|
|
|
|
on_delete=models.CASCADE)),
|
|
|
|
('diskspace', models.PositiveIntegerField(
|
|
|
|
verbose_name='disk space')),
|
|
|
|
('diskspace_unit', models.PositiveSmallIntegerField(
|
|
|
|
verbose_name='unit of disk space',
|
|
|
|
choices=[(0, 'MiB'), (1, 'GiB'), (2, 'TiB')])),
|
2015-01-18 13:22:06 +01:00
|
|
|
],
|
|
|
|
options={
|
|
|
|
'ordering': ['diskspace_unit', 'diskspace'],
|
|
|
|
'abstract': False,
|
|
|
|
'verbose_name': 'Disk space option',
|
|
|
|
'verbose_name_plural': 'Disk space options',
|
|
|
|
},
|
|
|
|
bases=('hostingpackages.hostingoption', models.Model),
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='HostingPackageTemplate',
|
|
|
|
fields=[
|
2018-11-19 23:28:40 +01:00
|
|
|
('id', models.AutoField(
|
|
|
|
verbose_name='ID', serialize=False, auto_created=True,
|
|
|
|
primary_key=True)),
|
|
|
|
('created', model_utils.fields.AutoCreatedField(
|
|
|
|
default=django.utils.timezone.now, verbose_name='created',
|
|
|
|
editable=False)),
|
|
|
|
('modified', model_utils.fields.AutoLastModifiedField(
|
|
|
|
default=django.utils.timezone.now, verbose_name='modified',
|
|
|
|
editable=False)),
|
|
|
|
('name', models.CharField(
|
|
|
|
unique=True, max_length=128, verbose_name='name')),
|
|
|
|
('description', models.TextField(
|
|
|
|
verbose_name='description', blank=True)),
|
|
|
|
('mailboxcount', models.PositiveIntegerField(
|
|
|
|
verbose_name='mailbox count')),
|
|
|
|
('diskspace', models.PositiveIntegerField(
|
|
|
|
help_text='disk space for the hosting package',
|
|
|
|
verbose_name='disk space')),
|
|
|
|
('diskspace_unit', models.PositiveSmallIntegerField(
|
|
|
|
verbose_name='unit of disk space',
|
|
|
|
choices=[(0, 'MiB'), (1, 'GiB'), (2, 'TiB')])),
|
2015-01-18 13:22:06 +01:00
|
|
|
],
|
|
|
|
options={
|
|
|
|
'verbose_name': 'Hosting package',
|
|
|
|
'verbose_name_plural': 'Hosting packages',
|
|
|
|
},
|
|
|
|
bases=(models.Model,),
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='MailboxOption',
|
|
|
|
fields=[
|
2018-11-19 23:28:40 +01:00
|
|
|
('hostingoption_ptr', models.OneToOneField(
|
|
|
|
parent_link=True, auto_created=True, primary_key=True,
|
|
|
|
serialize=False, to='hostingpackages.HostingOption',
|
|
|
|
on_delete=models.CASCADE)),
|
|
|
|
('number', models.PositiveIntegerField(
|
|
|
|
unique=True, verbose_name='number of mailboxes')),
|
2015-01-18 13:22:06 +01:00
|
|
|
],
|
|
|
|
options={
|
|
|
|
'ordering': ['number'],
|
|
|
|
'abstract': False,
|
|
|
|
'verbose_name': 'Mailbox option',
|
|
|
|
'verbose_name_plural': 'Mailbox options',
|
|
|
|
},
|
|
|
|
bases=('hostingpackages.hostingoption', models.Model),
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='UserDatabaseOption',
|
|
|
|
fields=[
|
2018-11-19 23:28:40 +01:00
|
|
|
('hostingoption_ptr', models.OneToOneField(
|
|
|
|
parent_link=True, auto_created=True, primary_key=True,
|
|
|
|
serialize=False, to='hostingpackages.HostingOption',
|
|
|
|
on_delete=models.CASCADE)),
|
|
|
|
('number', models.PositiveIntegerField(
|
|
|
|
default=1, verbose_name='number of databases')),
|
|
|
|
('db_type', models.PositiveSmallIntegerField(
|
|
|
|
verbose_name='database type',
|
|
|
|
choices=[(0, 'PostgreSQL'), (1, 'MySQL')])),
|
2015-01-18 13:22:06 +01:00
|
|
|
],
|
|
|
|
options={
|
|
|
|
'ordering': ['db_type', 'number'],
|
|
|
|
'abstract': False,
|
|
|
|
'verbose_name': 'Database option',
|
|
|
|
'verbose_name_plural': 'Database options',
|
|
|
|
},
|
|
|
|
bases=('hostingpackages.hostingoption', models.Model),
|
|
|
|
),
|
|
|
|
migrations.AlterUniqueTogether(
|
|
|
|
name='userdatabaseoption',
|
2018-11-19 23:28:40 +01:00
|
|
|
unique_together={('number', 'db_type')},
|
2015-01-18 13:22:06 +01:00
|
|
|
),
|
|
|
|
migrations.AlterUniqueTogether(
|
|
|
|
name='diskspaceoption',
|
2018-11-19 23:28:40 +01:00
|
|
|
unique_together={('diskspace', 'diskspace_unit')},
|
2015-01-18 13:22:06 +01:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='customeruserdatabaseoption',
|
|
|
|
name='template',
|
2018-11-19 23:28:40 +01:00
|
|
|
field=models.ForeignKey(
|
|
|
|
verbose_name='user database option template',
|
|
|
|
to='hostingpackages.UserDatabaseOption',
|
|
|
|
help_text='The user database option template that this '
|
|
|
|
'hosting option is based on',
|
|
|
|
on_delete=models.CASCADE),
|
2015-01-18 13:22:06 +01:00
|
|
|
preserve_default=True,
|
|
|
|
),
|
|
|
|
migrations.AlterUniqueTogether(
|
|
|
|
name='customeruserdatabaseoption',
|
2018-11-19 23:28:40 +01:00
|
|
|
unique_together={('number', 'db_type')},
|
2015-01-18 13:22:06 +01:00
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='customermailboxoption',
|
|
|
|
name='template',
|
2018-11-19 23:28:40 +01:00
|
|
|
field=models.ForeignKey(
|
|
|
|
verbose_name='mailbox option template',
|
|
|
|
to='hostingpackages.UserDatabaseOption',
|
|
|
|
help_text='The mailbox option template that this hosting '
|
|
|
|
'option is based on',
|
|
|
|
on_delete=models.CASCADE),
|
2015-01-18 13:22:06 +01:00
|
|
|
preserve_default=True,
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='customerhostingpackageoption',
|
|
|
|
name='hosting_package',
|
2018-11-19 23:28:40 +01:00
|
|
|
field=models.ForeignKey(
|
|
|
|
verbose_name='hosting package',
|
|
|
|
to='hostingpackages.CustomerHostingPackage',
|
|
|
|
on_delete=models.CASCADE),
|
2015-01-18 13:22:06 +01:00
|
|
|
preserve_default=True,
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='customerhostingpackage',
|
|
|
|
name='template',
|
2018-11-19 23:28:40 +01:00
|
|
|
field=models.ForeignKey(
|
|
|
|
verbose_name='hosting package template',
|
|
|
|
to='hostingpackages.HostingPackageTemplate',
|
|
|
|
help_text='The hosting package template that this hosting '
|
|
|
|
'package is based on.',
|
|
|
|
on_delete=models.CASCADE),
|
2015-01-18 13:22:06 +01:00
|
|
|
preserve_default=True,
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='customerdiskspaceoption',
|
|
|
|
name='template',
|
2018-11-19 23:28:40 +01:00
|
|
|
field=models.ForeignKey(
|
|
|
|
verbose_name='disk space option template',
|
|
|
|
to='hostingpackages.DiskSpaceOption',
|
|
|
|
help_text='The disk space option template that this hosting '
|
|
|
|
'option is based on',
|
|
|
|
on_delete=models.CASCADE),
|
2015-01-18 13:22:06 +01:00
|
|
|
preserve_default=True,
|
|
|
|
),
|
|
|
|
migrations.AlterUniqueTogether(
|
|
|
|
name='customerdiskspaceoption',
|
2018-11-19 23:28:40 +01:00
|
|
|
unique_together={('diskspace', 'diskspace_unit')},
|
2015-01-18 13:22:06 +01:00
|
|
|
),
|
|
|
|
]
|