<gh_stars>10-100
# Generated by Django 3.2.3 on 2021-05-21 03:46

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import functools
import organizations.fields
import purpleserver.core.models.base


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('graph', '0002_auto_20210512_1353'),
        ('events', '0001_initial'),
        ('providers', '0012_alter_carrier_options'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('core', '0001_initial'),
        ('manager', '0014_auto_20210515_0928'),
        ('user', '0002_token'),
    ]

    operations = [
        migrations.CreateModel(
            name='AddressLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='link', to='manager.address')),
            ],
        ),
        migrations.CreateModel(
            name='CarrierLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='link', to='providers.carrier')),
            ],
        ),
        migrations.CreateModel(
            name='CommodityLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='link', to='manager.commodity')),
            ],
        ),
        migrations.CreateModel(
            name='CustomsLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='link', to='manager.customs')),
            ],
        ),
        migrations.CreateModel(
            name='LogLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='link', to='core.apilog')),
            ],
        ),
        migrations.CreateModel(
            name='Organization',
            fields=[
                ('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)),
                ('id', models.CharField(default=functools.partial(purpleserver.core.models.base.uuid, *(), **{'prefix': 'org_'}), editable=False, max_length=50, primary_key=True, serialize=False)),
                ('addresses', models.ManyToManyField(related_name='org', through='orgs.AddressLink', to='manager.Address')),
                ('carriers', models.ManyToManyField(related_name='org', through='orgs.CarrierLink', to='providers.Carrier')),
                ('commodities', models.ManyToManyField(related_name='org', through='orgs.CommodityLink', to='manager.Commodity')),
                ('customs', models.ManyToManyField(related_name='org', through='orgs.CustomsLink', to='manager.Customs')),
                ('logs', models.ManyToManyField(related_name='org', through='orgs.LogLink', to='core.APILog')),
            ],
            options={
                'verbose_name': 'organization',
                'verbose_name_plural': 'organizations',
                'ordering': ['name'],
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='WebhookLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='link', to='events.webhook')),
                ('org', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='webhook_links', to='orgs.organization')),
            ],
        ),
        migrations.CreateModel(
            name='TrackerLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='link', to='manager.tracking')),
                ('org', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tracker_links', to='orgs.organization')),
            ],
        ),
        migrations.CreateModel(
            name='TokenLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='link', to='user.token')),
                ('org', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='token_links', to='orgs.organization')),
            ],
        ),
        migrations.CreateModel(
            name='TemplateLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='link', to='graph.template')),
                ('org', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='template_links', to='orgs.organization')),
            ],
        ),
        migrations.CreateModel(
            name='ShipmentLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='link', to='manager.shipment')),
                ('org', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='shipment_links', to='orgs.organization')),
            ],
        ),
        migrations.CreateModel(
            name='PickupLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='link', to='manager.pickup')),
                ('org', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pickup_links', to='orgs.organization')),
            ],
        ),
        migrations.CreateModel(
            name='ParcelLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='link', to='manager.parcel')),
                ('org', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='parcel_links', to='orgs.organization')),
            ],
        ),
        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)),
                ('is_admin', models.BooleanField(default=False)),
                ('organization', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='organization_users', to='orgs.organization')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='orgs_organizationuser', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'organization user',
                'verbose_name_plural': 'organization users',
                'ordering': ['organization', 'user'],
                'abstract': False,
                'unique_together': {('user', 'organization')},
            },
        ),
        migrations.CreateModel(
            name='OrganizationOwner',
            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)),
                ('organization', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='owner', to='orgs.organization')),
                ('organization_user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='orgs.organizationuser')),
            ],
            options={
                'verbose_name': 'organization owner',
                'verbose_name_plural': 'organization owners',
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='OrganizationInvitation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('guid', models.UUIDField(editable=False)),
                ('invitee_identifier', models.CharField(help_text='The contact identifier for the invitee, email, phone number, social media handle, etc.', max_length=1000)),
                ('created', organizations.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False)),
                ('modified', organizations.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False)),
                ('invited_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='orgs_organizationinvitation_sent_invitations', to=settings.AUTH_USER_MODEL)),
                ('invitee', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='orgs_organizationinvitation_invitations', to=settings.AUTH_USER_MODEL)),
                ('organization', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='organization_invites', to='orgs.organization')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='organization',
            name='parcels',
            field=models.ManyToManyField(related_name='org', through='orgs.ParcelLink', to='manager.Parcel'),
        ),
        migrations.AddField(
            model_name='organization',
            name='pickups',
            field=models.ManyToManyField(related_name='org', through='orgs.PickupLink', to='manager.Pickup'),
        ),
        migrations.AddField(
            model_name='organization',
            name='shipments',
            field=models.ManyToManyField(related_name='org', through='orgs.ShipmentLink', to='manager.Shipment'),
        ),
        migrations.AddField(
            model_name='organization',
            name='templates',
            field=models.ManyToManyField(related_name='org', through='orgs.TemplateLink', to='graph.Template'),
        ),
        migrations.AddField(
            model_name='organization',
            name='tokens',
            field=models.ManyToManyField(related_name='org', through='orgs.TokenLink', to='user.Token'),
        ),
        migrations.AddField(
            model_name='organization',
            name='trackers',
            field=models.ManyToManyField(related_name='org', through='orgs.TrackerLink', to='manager.Tracking'),
        ),
        migrations.AddField(
            model_name='organization',
            name='users',
            field=models.ManyToManyField(related_name='orgs_organization', through='orgs.OrganizationUser', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='organization',
            name='webhooks',
            field=models.ManyToManyField(related_name='org', through='orgs.WebhookLink', to='events.Webhook'),
        ),
        migrations.AddField(
            model_name='loglink',
            name='org',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='log_links', to='orgs.organization'),
        ),
        migrations.AddField(
            model_name='customslink',
            name='org',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='custom_links', to='orgs.organization'),
        ),
        migrations.AddField(
            model_name='commoditylink',
            name='org',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='commodity_links', to='orgs.organization'),
        ),
        migrations.AddField(
            model_name='carrierlink',
            name='org',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='carrier_links', to='orgs.organization'),
        ),
        migrations.AddField(
            model_name='addresslink',
            name='org',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='address_links', to='orgs.organization'),
        ),
    ]

# Generated by Django 3.2.3 on 2021-05-21 03:46

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import functools
import organizations.fields
import purpleserver.core.models.base


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('graph', '0002_auto_20210512_1353'),
        ('events', '0001_initial'),
        ('providers', '0012_alter_carrier_options'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('core', '0001_initial'),
        ('manager', '0014_auto_20210515_0928'),
        ('user', '0002_token'),
    ]

    operations = [
        migrations.CreateModel(
            name='AddressLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='link', to='manager.address')),
            ],
        ),
        migrations.CreateModel(
            name='CarrierLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='link', to='providers.carrier')),
            ],
        ),
        migrations.CreateModel(
            name='CommodityLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='link', to='manager.commodity')),
            ],
        ),
        migrations.CreateModel(
            name='CustomsLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='link', to='manager.customs')),
            ],
        ),
        migrations.CreateModel(
            name='LogLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='link', to='core.apilog')),
            ],
        ),
        migrations.CreateModel(
            name='Organization',
            fields=[
                ('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)),
                ('id', models.CharField(default=functools.partial(purpleserver.core.models.base.uuid, *(), **{'prefix': 'org_'}), editable=False, max_length=50, primary_key=True, serialize=False)),
                ('addresses', models.ManyToManyField(related_name='org', through='orgs.AddressLink', to='manager.Address')),
                ('carriers', models.ManyToManyField(related_name='org', through='orgs.CarrierLink', to='providers.Carrier')),
                ('commodities', models.ManyToManyField(related_name='org', through='orgs.CommodityLink', to='manager.Commodity')),
                ('customs', models.ManyToManyField(related_name='org', through='orgs.CustomsLink', to='manager.Customs')),
                ('logs', models.ManyToManyField(related_name='org', through='orgs.LogLink', to='core.APILog')),
            ],
            options={
                'verbose_name': 'organization',
                'verbose_name_plural': 'organizations',
                'ordering': ['name'],
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='WebhookLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='link', to='events.webhook')),
                ('org', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='webhook_links', to='orgs.organization')),
            ],
        ),
        migrations.CreateModel(
            name='TrackerLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='link', to='manager.tracking')),
                ('org', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tracker_links', to='orgs.organization')),
            ],
        ),
        migrations.CreateModel(
            name='TokenLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='link', to='user.token')),
                ('org', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='token_links', to='orgs.organization')),
            ],
        ),
        migrations.CreateModel(
            name='TemplateLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='link', to='graph.template')),
                ('org', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='template_links', to='orgs.organization')),
            ],
        ),
        migrations.CreateModel(
            name='ShipmentLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='link', to='manager.shipment')),
                ('org', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='shipment_links', to='orgs.organization')),
            ],
        ),
        migrations.CreateModel(
            name='PickupLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='link', to='manager.pickup')),
                ('org', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pickup_links', to='orgs.organization')),
            ],
        ),
        migrations.CreateModel(
            name='ParcelLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='link', to='manager.parcel')),
                ('org', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='parcel_links', to='orgs.organization')),
            ],
        ),
        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)),
                ('is_admin', models.BooleanField(default=False)),
                ('organization', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='organization_users', to='orgs.organization')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='orgs_organizationuser', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'organization user',
                'verbose_name_plural': 'organization users',
                'ordering': ['organization', 'user'],
                'abstract': False,
                'unique_together': {('user', 'organization')},
            },
        ),
        migrations.CreateModel(
            name='OrganizationOwner',
            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)),
                ('organization', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='owner', to='orgs.organization')),
                ('organization_user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='orgs.organizationuser')),
            ],
            options={
                'verbose_name': 'organization owner',
                'verbose_name_plural': 'organization owners',
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='OrganizationInvitation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('guid', models.UUIDField(editable=False)),
                ('invitee_identifier', models.CharField(help_text='The contact identifier for the invitee, email, phone number, social media handle, etc.', max_length=1000)),
                ('created', organizations.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False)),
                ('modified', organizations.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False)),
                ('invited_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='orgs_organizationinvitation_sent_invitations', to=settings.AUTH_USER_MODEL)),
                ('invitee', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='orgs_organizationinvitation_invitations', to=settings.AUTH_USER_MODEL)),
                ('organization', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='organization_invites', to='orgs.organization')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='organization',
            name='parcels',
            field=models.ManyToManyField(related_name='org', through='orgs.ParcelLink', to='manager.Parcel'),
        ),
        migrations.AddField(
            model_name='organization',
            name='pickups',
            field=models.ManyToManyField(related_name='org', through='orgs.PickupLink', to='manager.Pickup'),
        ),
        migrations.AddField(
            model_name='organization',
            name='shipments',
            field=models.ManyToManyField(related_name='org', through='orgs.ShipmentLink', to='manager.Shipment'),
        ),
        migrations.AddField(
            model_name='organization',
            name='templates',
            field=models.ManyToManyField(related_name='org', through='orgs.TemplateLink', to='graph.Template'),
        ),
        migrations.AddField(
            model_name='organization',
            name='tokens',
            field=models.ManyToManyField(related_name='org', through='orgs.TokenLink', to='user.Token'),
        ),
        migrations.AddField(
            model_name='organization',
            name='trackers',
            field=models.ManyToManyField(related_name='org', through='orgs.TrackerLink', to='manager.Tracking'),
        ),
        migrations.AddField(
            model_name='organization',
            name='users',
            field=models.ManyToManyField(related_name='orgs_organization', through='orgs.OrganizationUser', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='organization',
            name='webhooks',
            field=models.ManyToManyField(related_name='org', through='orgs.WebhookLink', to='events.Webhook'),
        ),
        migrations.AddField(
            model_name='loglink',
            name='org',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='log_links', to='orgs.organization'),
        ),
        migrations.AddField(
            model_name='customslink',
            name='org',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='custom_links', to='orgs.organization'),
        ),
        migrations.AddField(
            model_name='commoditylink',
            name='org',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='commodity_links', to='orgs.organization'),
        ),
        migrations.AddField(
            model_name='carrierlink',
            name='org',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='carrier_links', to='orgs.organization'),
        ),
        migrations.AddField(
            model_name='addresslink',
            name='org',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='address_links', to='orgs.organization'),
        ),
    ]
# Generated by Django 3.2.3 on 2021-05-21 03:46