# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-07-10 09:27
from __future__ import unicode_literals

from django.conf import settings
import django.contrib.auth.models
import django.contrib.postgres.fields.hstore
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='SunriseProfile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('username', models.CharField(max_length=30, unique=True)),
                ('first_name', models.CharField(blank=True, max_length=30)),
                ('last_name', models.CharField(blank=True, max_length=30)),
                ('email', models.EmailField(max_length=254)),
                ('is_active', models.BooleanField(default=True)),
                ('control_access', models.BooleanField(default=False)),
                ('change_password_after', models.BooleanField(default=True)),
                ('is_superuser', models.BooleanField(default=False)),
                ('is_staff', models.BooleanField(default=False)),
                ('description', models.CharField(blank=True, help_text=b'Description', max_length=50)),
                ('login_via', models.CharField(choices=[(b'Inbuilt', b'Hosted Website'), (b'LDAP', b'LDAP')], default=b'Inbuilt', help_text=b'Log-In via', max_length=20)),
                ('lockout_account', models.BooleanField(default=False, help_text=b'Lock-Out Account')),
                ('password_expired', models.BooleanField(default=False, help_text=b'Is Password Active?')),
                ('rec_sys_not', models.BooleanField(default=False, help_text=b'Receive System Notifications')),
                ('title', models.CharField(blank=True, help_text=b'Title', max_length=30, null=True)),
                ('login_attempts', models.PositiveSmallIntegerField(default=0, help_text=b'')),
                ('enable_trace_opt', models.BooleanField(default=False, help_text=b'Enable tracing options')),
                ('pwd_expire_from', models.DateTimeField(blank=True, help_text=b'Password Valid From', null=True)),
                ('pwd_expire_to', models.DateTimeField(blank=True, help_text=b'Password Valid To', null=True)),
                ('pwd_hint', models.CharField(blank=True, help_text=b'Password Hint', max_length=30, null=True)),
                ('otp_attempts', models.PositiveSmallIntegerField(default=0, help_text=b'')),
                ('audit_name', models.CharField(blank=True, help_text=b'Audit Name', max_length=30, verbose_name=b'Last Updated By:')),
                ('audit_dttm', models.DateTimeField(blank=True, help_text=b'Audit DateTime', null=True)),
                ('data', django.contrib.postgres.fields.hstore.HStoreField(null=True)),
            ],
            options={
                'db_table': 'sunrise_contrib_authentication_sunriseprofile',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, verbose_name=b'ID')),
                ('customer_id', models.CharField(help_text=b'Customer ID', max_length=50, unique=True)),
                ('name', models.CharField(blank=True, help_text=b'Name', max_length=30, null=True)),
                ('status', models.CharField(choices=[(b'Active', b'Active'), (b'Inactive', b'Inactive')], default=b'Active', help_text=b'Status', max_length=8)),
                ('address_line1', models.CharField(blank=True, help_text=b'Address Line1', max_length=30, null=True)),
                ('address_line2', models.CharField(blank=True, help_text=b'Address Line2', max_length=30)),
                ('address_line3', models.CharField(blank=True, help_text=b'Address Line3', max_length=30)),
                ('city', models.CharField(blank=True, help_text=b'City', max_length=20, null=True)),
                ('state', models.CharField(blank=True, help_text=b'State', max_length=2, null=True)),
                ('country', models.CharField(blank=True, help_text=b'Country', max_length=20, null=True)),
                ('postal_main', models.CharField(blank=True, help_text=b'Zip Code', max_length=5, null=True)),
                ('postal_add', models.CharField(blank=True, help_text=b'Postal Address', max_length=4)),
                ('phone', models.CharField(blank=True, help_text=b'Main Number', max_length=15)),
                ('phone_ext', models.CharField(blank=True, help_text=b'Ext', max_length=5)),
                ('pwd_min_length', models.CharField(default=8, help_text=b'Password Length', max_length=10)),
                ('upper_or_lower', models.BooleanField(default=False, help_text=b'Upper/Lower')),
                ('one_number', models.BooleanField(default=False, help_text=b'Use Atleast Number')),
                ('special_character', models.BooleanField(default=False, help_text=b'Special Character')),
                ('no_email', models.BooleanField(default=False, help_text=b'No Email')),
                ('no_first_or_last_name', models.BooleanField(default=False, help_text=b'No First/Last Name')),
                ('pwd_expire_period', models.CharField(blank=True, help_text=b'Password Expire Period', max_length=20, null=True)),
                ('max_login_attempts', models.CharField(blank=True, help_text=b'Maximum Login Attempts', max_length=20, null=True)),
                ('pwd_expire_check', models.CharField(blank=True, help_text=b'Password Expire Check', max_length=20, null=True)),
                ('pwd_expire_period_state', models.BooleanField(default=False, help_text=b'Password Expire Period State')),
                ('max_login_attempts_state', models.BooleanField(default=False, help_text=b'Max Login Attempts State')),
                ('username_case', models.BooleanField(default=False, help_text=b'UserName To Upper')),
                ('no_password_dictionary', models.BooleanField(default=False, help_text=b'No Password in Dictionary')),
                ('no_username', models.BooleanField(default=False, help_text=b'No Username')),
                ('min_old_passwords_remember', models.CharField(default=4, help_text=b'Number of old passwords to remember', max_length=20)),
                ('min_old_passwords_remember_state', models.BooleanField(default=False, help_text=b'Number of old passwords to remember state')),
                ('enable_mfa', models.BooleanField(default=False)),
                ('enable_saml', models.BooleanField(default=False)),
                ('saml_url', models.CharField(blank=True, max_length=100, null=True)),
                ('max_otp_attempts', models.CharField(blank=True, default=b'6', help_text=b'Maximum OTP Attempts', max_length=5, null=True)),
                ('audit_name', models.CharField(blank=True, help_text=b'Audit Name', max_length=20, null=True)),
                ('audit_dttm', models.DateTimeField(blank=True, help_text=b'Audit DateTime', null=True)),
                ('home_page_url', models.CharField(blank=True, max_length=100, null=True)),
                ('data', django.contrib.postgres.fields.hstore.HStoreField(null=True)),
            ],
            options={
                'db_table': 'sunrise_contrib_authentication_customer',
            },
        ),
        migrations.CreateModel(
            name='OldPasswords',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('pwds', models.CharField(max_length=200)),
                ('audit_dttm', models.DateTimeField(blank=True, null=True)),
                ('audit_user', models.CharField(blank=True, max_length=100, null=True)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='PageGroup',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('page', models.CharField(help_text=b'Page Name', max_length=100)),
                ('url', models.CharField(blank=True, help_text=b'Url', max_length=500)),
                ('page_description', models.TextField(blank=True, help_text=b'Description', null=True)),
                ('short_description', models.CharField(blank=True, help_text=b'Short Description', max_length=30, null=True)),
                ('page_category', models.CharField(choices=[(b'0', b'Base'), (b'1', b'Search Add View'), (b'2', b'Search View'), (b'3', b'View')], default=b'1', help_text=b'Page Mode', max_length=20)),
                ('audit_name', models.CharField(blank=True, help_text=b'Audit Name', max_length=30)),
                ('audit_dttm', models.DateTimeField(blank=True, help_text=b'Audit DateTime', null=True)),
                ('data', django.contrib.postgres.fields.hstore.HStoreField(null=True)),
            ],
            options={
                'db_table': 'sunrise_contrib_authentication_pagegroup',
            },
        ),
        migrations.CreateModel(
            name='RolePageAccess',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('access_type', models.CharField(choices=[(b'R', b'View'), (b'U', b'Add/Update')], default=b'R', help_text=b'Access Type', max_length=12)),
                ('is_active', models.BooleanField(default=True, help_text=b'Is Active')),
                ('data', django.contrib.postgres.fields.hstore.HStoreField(null=True)),
                ('page', models.ForeignKey(help_text=b'Page_ID', on_delete=django.db.models.deletion.CASCADE, to='authentication.PageGroup')),
            ],
            options={
                'db_table': 'sunrise_contrib_authentication_rolepageaccess',
            },
        ),
        migrations.CreateModel(
            name='SearchCriteria',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('description', models.CharField(blank=True, max_length=100, null=True)),
                ('type', models.CharField(choices=[(b'Private', b'Private'), (b'Public', b'Public')], default=b'Public', max_length=10)),
                ('created_by', models.CharField(blank=True, max_length=100, null=True)),
                ('url', models.CharField(max_length=100)),
                ('data', django.contrib.postgres.fields.hstore.HStoreField(null=True)),
            ],
            options={
                'db_table': 'sunrise_contrib_search_criteria',
            },
        ),
        migrations.CreateModel(
            name='SunriseProfileRolesAssigned',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('data', django.contrib.postgres.fields.hstore.HStoreField(null=True)),
                ('profile', models.ForeignKey(help_text=b'Profile_ID', on_delete=django.db.models.deletion.CASCADE, related_name='assigned_roles', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'sunrise_contrib_authentication_sunriseprofilerolesassigned',
            },
        ),
        migrations.CreateModel(
            name='SunriseRole',
            fields=[
                ('id', models.AutoField(help_text=b'ID', primary_key=True, serialize=False)),
                ('role_nm', models.CharField(help_text=b'Role ID', max_length=50)),
                ('description', models.TextField(blank=True, help_text=b'Description')),
                ('status', models.CharField(choices=[(b'Active', b'Active'), (b'Inactive', b'Inactive')], default=b'Active', help_text=b'Status', max_length=10)),
                ('is_support_admin', models.BooleanField(default=False, help_text=b'Is Support Admin')),
                ('audit_name', models.CharField(blank=True, help_text=b'Audit Name', max_length=30)),
                ('audit_dttm', models.DateTimeField(blank=True, help_text=b'Audit DateTime', null=True)),
                ('data', django.contrib.postgres.fields.hstore.HStoreField(null=True)),
                ('pages', models.ManyToManyField(help_text=b'Page Group', through='authentication.RolePageAccess', to='authentication.PageGroup')),
            ],
            options={
                'db_table': 'sunrise_contrib_authentication_sunriserole',
            },
        ),
        migrations.AddField(
            model_name='sunriseprofilerolesassigned',
            name='role',
            field=models.ForeignKey(help_text=b'Role_ID', on_delete=django.db.models.deletion.CASCADE, to='authentication.SunriseRole'),
        ),
        migrations.AddField(
            model_name='rolepageaccess',
            name='role',
            field=models.ForeignKey(help_text=b'Role_ID', on_delete=django.db.models.deletion.CASCADE, related_name='access_of_pages', to='authentication.SunriseRole'),
        ),
        migrations.AlterUniqueTogether(
            name='pagegroup',
            unique_together=set([('url', 'page')]),
        ),
        migrations.AddField(
            model_name='sunriseprofile',
            name='roles',
            field=models.ManyToManyField(help_text=b'Role', through='authentication.SunriseProfileRolesAssigned', to='authentication.SunriseRole'),
        ),
    ]
