12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- # Generated by Django 3.0.3 on 2020-02-28 17:52
- from django.conf import settings
- from django.db import migrations, models
- import django.db.models.deletion
- import django.utils.timezone
- import organizations.base
- import organizations.fields
- class Migration(migrations.Migration):
- initial = True
- dependencies = [
- migrations.swappable_dependency(settings.AUTH_USER_MODEL),
- ]
- operations = [
- migrations.CreateModel(
- name='Organization',
- fields=[
- ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('name', models.CharField(help_text='The name of the organization', max_length=200)),
- ('is_active', models.BooleanField(default=True)),
- ('created', organizations.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False)),
- ('modified', organizations.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False)),
- ('slug', organizations.fields.SlugField(blank=True, editable=False, help_text='The name in all lowercase, suitable for URL identification', max_length=200, populate_from='name', unique=True)),
- ],
- options={
- 'abstract': False,
- },
- bases=(organizations.base.UnicodeMixin, models.Model),
- ),
- migrations.CreateModel(
- name='OrganizationUser',
- fields=[
- ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('created', organizations.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False)),
- ('modified', organizations.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False)),
- ('role', models.PositiveSmallIntegerField(choices=[(0, 'Member'), (1, 'Admin'), (2, 'Manager'), (3, 'Owner')])),
- ('organization', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='organization_users', to='organizations_ext.Organization')),
- ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='organizations_ext_organizationuser', to=settings.AUTH_USER_MODEL)),
- ],
- options={
- 'abstract': False,
- },
- bases=(organizations.base.UnicodeMixin, models.Model),
- ),
- migrations.CreateModel(
- name='OrganizationOwner',
- fields=[
- ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('organization', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='owner', to='organizations_ext.Organization')),
- ('organization_user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='organizations_ext.OrganizationUser')),
- ],
- options={
- 'abstract': False,
- },
- bases=(organizations.base.UnicodeMixin, models.Model),
- ),
- migrations.AddField(
- model_name='organization',
- name='users',
- field=models.ManyToManyField(related_name='organizations_ext_organization', through='organizations_ext.OrganizationUser', to=settings.AUTH_USER_MODEL),
- ),
- ]
|