# Generated by Django 5.0 on 2024-01-19 19:14

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='SepaBranch',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('clave', models.CharField(blank=True, max_length=128)),
                ('nombre', models.CharField(blank=True, max_length=100)),
                ('telefono', models.CharField(blank=True, max_length=40)),
                ('correo', models.CharField(blank=True, max_length=240)),
                ('fecha_creacion', models.DateTimeField(auto_now_add=True)),
                ('fecha_actualizacion', models.DateTimeField(auto_now_add=True)),
                ('conf_ip_ext', models.CharField(blank=True, max_length=40)),
                ('conf_ip_int', models.CharField(blank=True, max_length=40, null=True)),
                ('conf_user', models.CharField(blank=True, max_length=40)),
                ('conf_pass', models.CharField(blank=True, max_length=40)),
                ('conf_db', models.CharField(blank=True, max_length=80)),
                ('conf_port', models.CharField(blank=True, max_length=80, null=True)),
                ('id_intelisis', models.IntegerField(blank=True)),
                ('empresa_intelisis', models.CharField(blank=True, max_length=80)),
                ('foto', models.ImageField(null=True, upload_to='branch')),
                ('foto_alt', models.ImageField(null=True, upload_to='branch_alt')),
                ('eliminado', models.BooleanField(default=False)),
                ('direccion', models.CharField(blank=True, max_length=500, null=True)),
                ('latitud', models.CharField(blank=True, max_length=50, null=True)),
                ('longitud', models.CharField(blank=True, max_length=50, null=True)),
                ('gwmbac', models.CharField(blank=True, max_length=50, null=True)),
                ('id_district', models.IntegerField(blank=True, null=True)),
                ('fotos_recepcion', models.CharField(blank=True, max_length=500, null=True)),
                ('db_recepcion', models.CharField(blank=True, max_length=50, null=True)),
                ('ciudad', models.CharField(blank=True, max_length=40, null=True)),
                ('id_agencia_crm', models.IntegerField(blank=True, null=True)),
                ('version', models.IntegerField(blank=True, null=True)),
            ],
            options={
                'db_table': 'api_sepa_branch',
            },
        ),
        migrations.CreateModel(
            name='SepaCompanies',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('clave', models.CharField(blank=True, max_length=128)),
                ('razonsocial', models.CharField(max_length=100)),
                ('rfc', models.CharField(max_length=40)),
                ('fecha_creacion', models.DateTimeField(auto_now_add=True)),
                ('fecha_actualizacion', models.DateTimeField(auto_now_add=True)),
                ('id_intelisis', models.IntegerField(blank=True)),
                ('foto', models.ImageField(upload_to='companies')),
                ('foto_alt', models.ImageField(upload_to='companies_alt')),
                ('eliminado', models.BooleanField(default=False)),
            ],
            options={
                'db_table': 'api_sepa_companies',
            },
        ),
        migrations.CreateModel(
            name='SepaCurrentVersion',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('nombre', models.CharField(blank=True, max_length=120)),
                ('features', models.CharField(blank=True, max_length=120)),
                ('fixes', models.TextField(blank=True, max_length=2400)),
                ('fecha_creacion', models.DateTimeField(auto_now_add=True)),
                ('fecha_actualizacion', models.DateTimeField(auto_now_add=True)),
                ('eliminado', models.BooleanField(default=False)),
            ],
            options={
                'db_table': 'api_sepa_current_version',
            },
        ),
        migrations.CreateModel(
            name='UserAPI',
            fields=[
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('code_verification', models.CharField(blank=True, max_length=20)),
                ('usuario', models.CharField(blank=True, max_length=254, unique=True)),
                ('password', models.CharField(blank=True, max_length=100)),
                ('nombres', models.CharField(blank=True, max_length=180)),
                ('ap_paterno', models.CharField(blank=True, max_length=100)),
                ('ap_materno', models.CharField(blank=True, max_length=100)),
                ('telefono', models.CharField(blank=True, max_length=40)),
                ('correo', models.CharField(blank=True, max_length=240)),
                ('fecha_creacion', models.DateTimeField(auto_now_add=True)),
                ('fecha_actualizacion', models.DateTimeField(auto_now_add=True)),
                ('id_intelisis', models.CharField(blank=True, max_length=100, null=True)),
                ('id_ckt', models.CharField(blank=True, max_length=100, null=True)),
                ('token_device', models.CharField(blank=True, max_length=100, null=True)),
                ('foto', models.ImageField(upload_to='users')),
                ('foto_alt', models.ImageField(upload_to='users_alt')),
                ('eliminado', models.BooleanField(default=False)),
                ('api_sctoken', models.CharField(blank=True, max_length=150)),
                ('api_scLastLoggedIn', models.DateTimeField(auto_now_add=True)),
                ('api_scInserted', models.BooleanField(default=False)),
                ('is_active', models.BooleanField(default=True)),
                ('is_staff', models.BooleanField(default=False)),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.permission', verbose_name='user permissions')),
                ('id_branch', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='users', to='isapilib.sepabranch')),
                ('id_current_version', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='users', to='isapilib.sepacurrentversion')),
            ],
            options={
                'db_table': 'api_user',
            },
        ),
        migrations.CreateModel(
            name='SepaBranchUsers',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('fecharegistro', models.DateTimeField(auto_now_add=True)),
                ('fechaactualiza', models.DateTimeField(auto_now=True)),
                ('eliminado', models.BooleanField(default=False)),
                ('idbranch', models.ForeignKey(db_column='idbranch', on_delete=django.db.models.deletion.CASCADE, related_name='permissions', to='isapilib.sepabranch')),
                ('iduser', models.ForeignKey(db_column='iduser', on_delete=django.db.models.deletion.CASCADE, related_name='permissions', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'api_branch_users',
            },
        ),
        migrations.AddField(
            model_name='sepabranch',
            name='id_company',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='branches', to='isapilib.sepacompanies'),
        ),
    ]
