class Migration(migrations.Migration):

    dependencies = [
        ('custom_source', '0002_auto_20190924_1209'),
    ]

    operations = [
        migrations.CreateModel(
            name='Record',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('uid',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  unique=True)),
                ('datetime_created',
                 models.DateTimeField(
                     default=caracal.common.models.get_utc_datetime_now)),
                ('position',
                 django.contrib.gis.db.models.fields.PointField(srid=4326)),
                ('datetime_recorded', models.DateTimeField(null=True)),
                ('temperature_celcius',
                 models.DecimalField(decimal_places=1, max_digits=5,
                                     null=True)),
                ('altitude_m',
                 models.DecimalField(decimal_places=2,
                                     max_digits=12,
                                     null=True)),
                ('speed_kmh',
                 models.DecimalField(decimal_places=2,
                                     max_digits=12,
                                     null=True)),
            ],
            options={
                'ordering': ['-datetime_created'],
            },
        ),
        migrations.AlterField(
            model_name='source',
            name='datetime_created',
            field=models.DateTimeField(
                default=caracal.common.models.get_utc_datetime_now),
        ),
        migrations.AddField(
            model_name='record',
            name='source',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='custom_source.Source'),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('custom_source', '0008_auto_20191002_1625'),
    ]

    operations = [
        migrations.CreateModel(
            name='Device',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('uid',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  unique=True)),
                ('datetime_created',
                 models.DateTimeField(
                     default=caracal.common.models.get_utc_datetime_now)),
                ('datetime_updated', models.DateTimeField(null=True)),
                ('datetime_deleted', models.DateTimeField(null=True)),
                ('is_active', models.BooleanField(default=True)),
                ('device_id',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('name', models.CharField(blank=True,
                                          max_length=100,
                                          null=True)),
                ('description',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('source',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='custom_source.Source')),
            ],
            options={
                'ordering': ['-datetime_created'],
            },
        ),
        migrations.RemoveField(
            model_name='record',
            name='device_id',
        ),
        migrations.AddField(
            model_name='record',
            name='device',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='custom_source.Device'),
        ),
    ]
Пример #3
0
class Migration(migrations.Migration):

    dependencies = [
        ('jackal', '0011_auto_20200214_1249'),
    ]

    operations = [
        migrations.CreateModel(
            name='Log',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('uid',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  unique=True)),
                ('datetime_created',
                 models.DateTimeField(
                     default=caracal.common.models.get_utc_datetime_now)),
                ('datetime_recorded', models.DateTimeField()),
                ('level', models.CharField(max_length=50)),
                ('message', models.TextField()),
                ('network',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='logs',
                                   to='jackal.Network')),
                ('phone',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='logs',
                                   to='jackal.Phone')),
            ],
            options={
                'ordering': ['-datetime_recorded'],
            },
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('outputs', '0016_auto_20200219_0838'),
    ]

    operations = [
        migrations.AddField(
            model_name='jackalagolconnection',
            name='datetime_created',
            field=models.DateTimeField(
                default=caracal.common.models.get_utc_datetime_now),
        ),
        migrations.AddField(
            model_name='jackalagolconnection',
            name='datetime_deleted',
            field=models.DateTimeField(null=True),
        ),
        migrations.AddField(
            model_name='jackalagolconnection',
            name='datetime_updated',
            field=models.DateTimeField(null=True),
        ),
        migrations.AddField(
            model_name='jackalagolconnection',
            name='is_active',
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name='jackalagolconnection',
            name='uid',
            field=models.UUIDField(default=uuid.uuid4,
                                   editable=False,
                                   unique=True),
        ),
    ]
Пример #5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('account', '0040_remove_realtimeaccount_agol_layer_id'),
    ]

    operations = [
        migrations.CreateModel(
            name='Call',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('uid',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  unique=True)),
                ('datetime_created',
                 models.DateTimeField(
                     default=caracal.common.models.get_utc_datetime_now)),
                ('datetime_recorded', models.DateTimeField()),
                ('is_sent', models.BooleanField()),
                ('other_phone_number', models.CharField(max_length=50)),
                ('duration_secs', models.IntegerField()),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Contact',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('uid',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  unique=True)),
                ('datetime_created',
                 models.DateTimeField(
                     default=caracal.common.models.get_utc_datetime_now)),
                ('datetime_recorded', models.DateTimeField()),
                ('name', models.CharField(blank=True, max_length=255)),
                ('phone_number', models.CharField(max_length=50)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Location',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('uid',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  unique=True)),
                ('datetime_created',
                 models.DateTimeField(
                     default=caracal.common.models.get_utc_datetime_now)),
                ('datetime_recorded', models.DateTimeField()),
                ('position',
                 django.contrib.gis.db.models.fields.PointField(srid=4326)),
                ('accuracy_m',
                 models.DecimalField(decimal_places=2, max_digits=10)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Network',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('uid',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  unique=True)),
                ('datetime_created',
                 models.DateTimeField(
                     default=caracal.common.models.get_utc_datetime_now)),
                ('datetime_updated', models.DateTimeField(null=True)),
                ('datetime_deleted', models.DateTimeField(null=True)),
                ('is_active', models.BooleanField(default=True)),
                ('write_key', models.CharField(max_length=100)),
                ('organization',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='jackal_network',
                     to='account.Organization')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Phone',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('uid',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  unique=True)),
                ('datetime_created',
                 models.DateTimeField(
                     default=caracal.common.models.get_utc_datetime_now)),
                ('datetime_updated', models.DateTimeField(null=True)),
                ('datetime_deleted', models.DateTimeField(null=True)),
                ('is_active', models.BooleanField(default=True)),
                ('device_id', models.CharField(max_length=200)),
                ('status',
                 models.CharField(choices=[('deployed', 'deployed'),
                                           ('inactive', 'inactive'),
                                           ('pending', 'pending')],
                                  default='pending',
                                  max_length=50)),
                ('name', models.CharField(blank=True, max_length=50,
                                          null=True)),
                ('description',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('mark', models.CharField(blank=True,
                                          max_length=100,
                                          null=True)),
                ('phone_numbers',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('network',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='phones',
                                   to='jackal.Network')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Text',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('uid',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  unique=True)),
                ('datetime_created',
                 models.DateTimeField(
                     default=caracal.common.models.get_utc_datetime_now)),
                ('datetime_recorded', models.DateTimeField()),
                ('is_sent', models.BooleanField()),
                ('other_phone_number', models.CharField(max_length=50)),
                ('message', models.TextField(blank=True)),
                ('network',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='texts',
                                   to='jackal.Network')),
                ('phone',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='texts',
                                   to='jackal.Phone')),
            ],
        ),
        migrations.AddField(
            model_name='location',
            name='network',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='locations',
                to='jackal.Network'),
        ),
        migrations.AddField(
            model_name='location',
            name='phone',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='locations',
                to='jackal.Phone'),
        ),
        migrations.AddField(
            model_name='contact',
            name='network',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='contacts',
                to='jackal.Network'),
        ),
        migrations.AddField(
            model_name='contact',
            name='phone',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='contacts',
                to='jackal.Phone'),
        ),
        migrations.AddField(
            model_name='call',
            name='network',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='calls',
                to='jackal.Network'),
        ),
        migrations.AddField(
            model_name='call',
            name='phone',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='calls',
                to='jackal.Phone'),
        ),
        migrations.AlterUniqueTogether(
            name='text',
            unique_together={('phone', 'datetime_recorded', 'message')},
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('jackal', '0006_auto_20200213_1859'),
    ]

    operations = [
        migrations.CreateModel(
            name='WhatsAppCall',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('uid',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  unique=True)),
                ('datetime_created',
                 models.DateTimeField(
                     default=caracal.common.models.get_utc_datetime_now)),
                ('datetime_recorded', models.DateTimeField()),
                ('call_log_id', models.IntegerField()),
                ('duration_secs', models.IntegerField()),
                ('from_me', models.BooleanField()),
                ('network',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='whatsapp_calls',
                                   to='jackal.Network')),
                ('phone',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='whatsapp_calls',
                                   to='jackal.Phone')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='WhatsAppGroup',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('uid',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  unique=True)),
                ('datetime_created',
                 models.DateTimeField(
                     default=caracal.common.models.get_utc_datetime_now)),
                ('datetime_recorded', models.DateTimeField()),
                ('jid_id', models.IntegerField()),
                ('subject',
                 models.CharField(blank=True, max_length=200, null=True)),
                ('network',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='whatsapp_groups',
                                   to='jackal.Network')),
                ('phone',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='whatsapp_groups',
                                   to='jackal.Phone')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='WhatsAppMessage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('uid',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  unique=True)),
                ('datetime_created',
                 models.DateTimeField(
                     default=caracal.common.models.get_utc_datetime_now)),
                ('datetime_recorded', models.DateTimeField()),
                ('from_me', models.BooleanField()),
                ('media_url', models.TextField(blank=True, null=True)),
                ('message', models.TextField(blank=True, null=True)),
                ('messages_id', models.IntegerField()),
                ('network',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='whatsapp_messages',
                                   to='jackal.Network')),
                ('phone',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='whatsapp_messages',
                                   to='jackal.Phone')),
                ('whatsapp_group',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='whatsapp_messages',
                                   to='jackal.WhatsAppGroup')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='WhatsAppUser',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('uid',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  unique=True)),
                ('datetime_created',
                 models.DateTimeField(
                     default=caracal.common.models.get_utc_datetime_now)),
                ('datetime_recorded', models.DateTimeField()),
                ('jid_id', models.IntegerField()),
                ('phone_number', models.CharField(max_length=50)),
                ('groups', models.ManyToManyField(to='jackal.WhatsAppGroup')),
                ('network',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='whatsapp_users',
                                   to='jackal.Network')),
                ('phone',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='whatsapp_users',
                                   to='jackal.Phone')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='whatsappmessage',
            name='whatsapp_user',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='whatsapp_messages',
                to='jackal.WhatsAppUser'),
        ),
        migrations.AddField(
            model_name='whatsappcall',
            name='whatsapp_user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='whatsapp_calls',
                to='jackal.WhatsAppUser'),
        ),
    ]
Пример #7
0
class Migration(migrations.Migration):

    dependencies = [
        ('jackal', '0002_auto_20191016_1359'),
    ]

    operations = [
        migrations.CreateModel(
            name='OtherPhone',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('uid',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  unique=True)),
                ('datetime_created',
                 models.DateTimeField(
                     default=caracal.common.models.get_utc_datetime_now)),
                ('datetime_updated', models.DateTimeField(null=True)),
                ('datetime_deleted', models.DateTimeField(null=True)),
                ('is_active', models.BooleanField(default=True)),
                ('phone_number', models.CharField(max_length=30, unique=True)),
                ('name', models.CharField(blank=True, max_length=50,
                                          null=True)),
                ('description',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('mark', models.CharField(blank=True,
                                          max_length=100,
                                          null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AlterModelOptions(
            name='phone',
            options={'ordering': ['-datetime_created']},
        ),
        migrations.AlterField(
            model_name='network',
            name='write_key',
            field=models.CharField(editable=False, max_length=100),
        ),
        migrations.AddField(
            model_name='call',
            name='other_phone',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='calls',
                to='jackal.OtherPhone'),
        ),
        migrations.AlterUniqueTogether(
            name='call',
            unique_together={('phone', 'other_phone', 'datetime_recorded',
                              'is_sent', 'duration_secs')},
        ),
        migrations.RemoveField(
            model_name='call',
            name='other_phone_number',
        )
    ]
Пример #8
0
class Migration(migrations.Migration):

    dependencies = [
        ('account', '0035_auto_20190927_1801'),
        ('custom_source', '0006_auto_20190926_1923'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('outputs', '0005_auto_20190924_1915'),
    ]

    operations = [
        migrations.CreateModel(
            name='AgolAccount',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('uid',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  unique=True)),
                ('datetime_created',
                 models.DateTimeField(
                     default=caracal.common.models.get_utc_datetime_now)),
                ('datetime_updated', models.DateTimeField(null=True)),
                ('datetime_deleted', models.DateTimeField(null=True)),
                ('is_active', models.BooleanField(default=True)),
                ('oauth_access_token', models.TextField(blank=True,
                                                        null=True)),
                ('oauth_access_token_expiry',
                 models.DateTimeField(blank=True, null=True)),
                ('oauth_refresh_token', models.TextField(blank=True,
                                                         null=True)),
                ('group_id',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('feature_service_url',
                 models.CharField(blank=True, max_length=200, null=True)),
                ('username',
                 models.CharField(blank=True, max_length=200, null=True)),
                ('account',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='agol_account',
                     to=settings.AUTH_USER_MODEL)),
                ('organization',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='agol_accounts',
                                   to='account.Organization')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.RemoveField(
            model_name='dataoutput',
            name='organization',
        ),
        migrations.RemoveField(
            model_name='dataconnection',
            name='output',
        ),
        migrations.RemoveField(
            model_name='dataconnection',
            name='realtime_alert',
        ),
        migrations.AddField(
            model_name='dataconnection',
            name='account',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='connections',
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='dataconnection',
            name='custom_source',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='connections',
                to='custom_source.Source'),
        ),
        migrations.AlterField(
            model_name='dataconnection',
            name='organization',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='connections',
                to='account.Organization'),
        ),
        migrations.DeleteModel(name='DataOutput', ),
        migrations.AddField(
            model_name='dataconnection',
            name='agol_account',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='connections',
                to='outputs.AgolAccount'),
        ),
    ]