2023-10-24 16:59:02 +00:00
|
|
|
# Generated by Django 2.2.28 on 2023-06-28 17:06
|
2015-04-08 14:41:09 +00:00
|
|
|
|
|
|
|
from django.conf import settings
|
2023-10-24 16:59:02 +00:00
|
|
|
from django.db import migrations, models
|
2021-04-22 12:18:01 +00:00
|
|
|
import django.db.models.deletion
|
2015-04-29 13:55:22 +00:00
|
|
|
import orchestra.core.validators
|
2015-04-08 14:41:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
2023-10-24 16:59:02 +00:00
|
|
|
initial = True
|
|
|
|
|
2015-04-08 14:41:09 +00:00
|
|
|
dependencies = [
|
|
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
2023-10-24 16:59:02 +00:00
|
|
|
name='DatabaseUser',
|
2015-04-08 14:41:09 +00:00
|
|
|
fields=[
|
2023-10-24 16:59:02 +00:00
|
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
|
('username', models.CharField(max_length=16, validators=[orchestra.core.validators.validate_name], verbose_name='username')),
|
|
|
|
('password', models.CharField(max_length=256, verbose_name='password')),
|
|
|
|
('type', models.CharField(choices=[('mysql', 'MySQL')], default='mysql', max_length=32, verbose_name='type')),
|
|
|
|
('account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='databaseusers', to=settings.AUTH_USER_MODEL, verbose_name='Account')),
|
2015-04-08 14:41:09 +00:00
|
|
|
],
|
2023-10-24 16:59:02 +00:00
|
|
|
options={
|
|
|
|
'verbose_name_plural': 'DB users',
|
|
|
|
'unique_together': {('username', 'type')},
|
|
|
|
},
|
2015-04-08 14:41:09 +00:00
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
2023-10-24 16:59:02 +00:00
|
|
|
name='Database',
|
2015-04-08 14:41:09 +00:00
|
|
|
fields=[
|
2023-10-24 16:59:02 +00:00
|
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
|
('name', models.CharField(max_length=64, validators=[orchestra.core.validators.validate_name], verbose_name='name')),
|
|
|
|
('type', models.CharField(choices=[('mysql', 'MySQL')], default='mysql', max_length=32, verbose_name='type')),
|
|
|
|
('comments', models.TextField(blank=True, default='')),
|
|
|
|
('account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='databases', to=settings.AUTH_USER_MODEL, verbose_name='Account')),
|
|
|
|
('users', models.ManyToManyField(blank=True, related_name='databases', to='databases.DatabaseUser', verbose_name='users')),
|
2015-04-08 14:41:09 +00:00
|
|
|
],
|
|
|
|
options={
|
2023-10-24 16:59:02 +00:00
|
|
|
'unique_together': {('name', 'type')},
|
2015-04-08 14:41:09 +00:00
|
|
|
},
|
|
|
|
),
|
|
|
|
]
|