django-orchestra-test/orchestra/contrib/saas/migrations/0001_initial.py

40 lines
2.0 KiB
Python
Raw Normal View History

2015-04-08 14:41:09 +00:00
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
2015-04-08 14:41:09 +00:00
import jsonfield.fields
from django.conf import settings
2015-04-29 13:55:22 +00:00
import orchestra.core.validators
2015-04-08 14:41:09 +00:00
class Migration(migrations.Migration):
dependencies = [
('databases', '0001_initial'),
2015-04-29 13:55:22 +00:00
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
2015-04-08 14:41:09 +00:00
]
operations = [
migrations.CreateModel(
name='SaaS',
fields=[
2015-04-29 14:32:38 +00:00
('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)),
2015-04-29 13:55:22 +00:00
('service', models.CharField(max_length=32, verbose_name='service', choices=[('bscw', 'BSCW'), ('DokuWikiService', 'Dowkuwiki'), ('DrupalService', 'Drupal'), ('gitlab', 'GitLab'), ('MoodleService', 'Moodle'), ('seafile', 'SeaFile'), ('WordPressService', 'WordPress'), ('phplist', 'phpList')])),
2015-04-29 14:32:38 +00:00
('name', models.CharField(max_length=64, validators=[orchestra.core.validators.validate_username], verbose_name='Name', help_text='Required. 64 characters or fewer. Letters, digits and ./-/_ only.')),
2015-04-08 14:41:09 +00:00
('is_active', models.BooleanField(help_text='Designates whether this service should be treated as active. ', verbose_name='active', default=True)),
('data', jsonfield.fields.JSONField(help_text='Extra information dependent of each service.', verbose_name='data', default={})),
('account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, verbose_name='account', to=settings.AUTH_USER_MODEL, related_name='saas')),
('database', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, null=True, blank=True, to='databases.Database')),
2015-04-08 14:41:09 +00:00
],
options={
'verbose_name_plural': 'SaaS',
2015-04-29 14:32:38 +00:00
'verbose_name': 'SaaS',
2015-04-08 14:41:09 +00:00
},
),
migrations.AlterUniqueTogether(
name='saas',
unique_together=set([('name', 'service')]),
),
]