# Generated by Django 2.2.3 on 2019-10-25 09:12

import datetime

import django.db.models.deletion
import django_countries.fields
import timezone_field.fields
from django.conf import settings
from django.db import migrations, models

import django_rest_template.apps.common.fields
import django_rest_template.apps.venue.models


class Migration(migrations.Migration):
	initial = True

	dependencies = [
		('auth', '0011_update_proxy_permissions'),
	]

	operations = [
		migrations.CreateModel(
			name='User',
			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')),
				('created_date', models.DateTimeField(auto_now=True)),
				('modified_date', models.DateTimeField(auto_now=True)),
				('email', models.EmailField(
					blank=True, db_index=True, max_length=100, null=True, unique=True)),
				('is_active', models.BooleanField(db_column='active', default=False)),
				('date_joined', models.DateTimeField(
					blank=True, db_column='dt', default=datetime.datetime.now, null=True)),
				('is_admin', models.NullBooleanField(db_column='isadmin', default=False)),
			],
			options={
				'db_table': 'psp_users',
			},
			managers=[
				('objects', django_rest_template.apps.venue.models.UserManager()),
			],
		),
		migrations.CreateModel(
			name='Role',
			fields=[
				('id', models.AutoField(
					auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
				('created_date', models.DateTimeField(auto_now=True)),
				('modified_date', models.DateTimeField(auto_now=True)),
				('name', models.CharField(max_length=50)),
			],
			options={
				'db_table': 'psp_roles',
			},
		),
		migrations.CreateModel(
			name='UsersVenues',
			fields=[
				('id', models.AutoField(
					auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
				('created_date', models.DateTimeField(auto_now=True)),
				('modified_date', models.DateTimeField(auto_now=True)),
				('user', models.ForeignKey(
					db_column='psp_user_id', on_delete=django.db.models.deletion.CASCADE,
					to=settings.AUTH_USER_MODEL)),
			],
			options={
				'verbose_name_plural': 'Users Venues',
				'db_table': 'psp_users_venues',
			},
		),
		migrations.CreateModel(
			name='Venue',
			fields=[
				('id', models.AutoField(
					auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
				('created_date', models.DateTimeField(auto_now=True)),
				('modified_date', models.DateTimeField(auto_now=True)),
				('name', models.CharField(blank=True, max_length=100, null=True)),
				('address', models.TextField(blank=True, null=True)),
				('active', models.IntegerField()),
				(
					'url_component',
					django_rest_template.apps.common.fields.LowerCaseCharField(
						blank=True, db_column='url', max_length=200, null=True, unique=True)),
				('local_timezone', timezone_field.fields.TimeZoneField(default='Europe/London')),
				('country', django_countries.fields.CountryField(default='GB', max_length=2)),
				('language_code', models.CharField(
					choices=[
						('af', 'Afrikaans'), ('ar', 'Arabic'), ('ast', 'Asturian'),
						('az', 'Azerbaijani'), ('bg', 'Bulgarian'), ('be', 'Belarusian'),
						('bn', 'Bengali'), ('br', 'Breton'), ('bs', 'Bosnian'),
						('ca', 'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'),
						('de', 'German'), ('dsb', 'Lower Sorbian'), ('el', 'Greek'),
						('en', 'English'), ('en-au', 'Australian English'),
						('en-gb', 'British English'), ('eo', 'Esperanto'), ('es', 'Spanish'),
						('es-ar', 'Argentinian Spanish'), ('es-co', 'Colombian Spanish'),
						('es-mx', 'Mexican Spanish'), ('es-ni', 'Nicaraguan Spanish'),
						('es-ve', 'Venezuelan Spanish'), ('et', 'Estonian'), ('eu', 'Basque'),
						('fa', 'Persian'), ('fi', 'Finnish'), ('fr', 'French'),
						('fy', 'Frisian'), ('ga', 'Irish'), ('gd', 'Scottish Gaelic'),
						('gl', 'Galician'), ('he', 'Hebrew'), ('hi', 'Hindi'),
						('hr', 'Croatian'), ('hsb', 'Upper Sorbian'), ('hu', 'Hungarian'),
						('hy', 'Armenian'), ('ia', 'Interlingua'), ('id', 'Indonesian'),
						('io', 'Ido'), ('is', 'Icelandic'), ('it', 'Italian'),
						('ja', 'Japanese'), ('ka', 'Georgian'), ('kab', 'Kabyle'),
						('kk', 'Kazakh'), ('km', 'Khmer'), ('kn', 'Kannada'), ('ko', 'Korean'),
						('lb', 'Luxembourgish'), ('lt', 'Lithuanian'), ('lv', 'Latvian'),
						('mk', 'Macedonian'), ('ml', 'Malayalam'), ('mn', 'Mongolian'),
						('mr', 'Marathi'), ('my', 'Burmese'), ('nb', 'Norwegian Bokmål'),
						('ne', 'Nepali'), ('nl', 'Dutch'), ('nn', 'Norwegian Nynorsk'),
						('os', 'Ossetic'), ('pa', 'Punjabi'), ('pl', 'Polish'),
						('pt', 'Portuguese'), ('pt-br', 'Brazilian Portuguese'),
						('ro', 'Romanian'), ('ru', 'Russian'), ('sk', 'Slovak'),
						('sl', 'Slovenian'), ('sq', 'Albanian'), ('sr', 'Serbian'),
						('sr-latn', 'Serbian Latin'), ('sv', 'Swedish'), ('sw', 'Swahili'),
						('ta', 'Tamil'), ('te', 'Telugu'), ('th', 'Thai'), ('tr', 'Turkish'),
						('tt', 'Tatar'), ('udm', 'Udmurt'), ('uk', 'Ukrainian'),
						('ur', 'Urdu'), ('vi', 'Vietnamese'),
						('zh-hans', 'Simplified Chinese'), ('zh-hant', 'Traditional Chinese')],
					default='en-gb', max_length=7)),
				('users', models.ManyToManyField(
					through='venue.UsersVenues', to=settings.AUTH_USER_MODEL)),
			],
			options={
				'db_table': 'psp_venues',
			},
		),
		migrations.CreateModel(
			name='VenueSetting',
			fields=[
				('id', models.AutoField(
					auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
				('created_date', models.DateTimeField(auto_now=True)),
				('modified_date', models.DateTimeField(auto_now=True)),
				('label', models.CharField(blank=True, max_length=200, null=True)),
				('var_define', models.CharField(
					choices=[
						('dateFormat.shortTime', 'Time format (e.g. HH:mm)'),
						('dateFormat.mediumDate', 'Date format (e.g. dd-MMM-yyy)'), (
							'dateFormat.medium',
							'Date format with time (e.g. dd-MMM-yyyy HH:mm)'),
						(
							'dateFormat.full',
							'Date format with day-of-week and time (e.g. EEE d MMM HH:mm)'),
						('TERMS_URL', 'T&C link'),
						('PRIVACY_POLICY_URL', 'Privacy Policy link'),
						('DEFAULT_LANGUAGE_CODE', 'Default language (example: en-us)'),
						('ENABLE_DEPOSIT', 'Enable usage of the Deposit system for payments'),
						(
							'DEFAULT_CURRENCY',
							'Default currency for the Deposit system (example: usd, ush,...)'),
						(
							'MANDATORY_CREDIT_CARD',
							'User must enter their credit card info before being able to add a contribution'),
						(
							'STARTING_DAY_IN_WEEK',
							'Starting day in week for calendar, format: 0=Sunday, 1=Monday, '
							'2=Tuesday, 3=Wednesday, 4=Thursday, 5=Friday, 6=Saturday'),
						('VENUE_ADMIN_EMAIL', 'Venue Admin email'), (
							'HIDE_DATE_AND_TIME_HEADER_BAR',
							'Hide date and time in the header bar'),
						('HIDE_DRIVER_CHECKBOX', 'Hide driver checkbox'),
						('USE_STRIPE_MAIN_ACCOUNT', 'Enable Use of stripe main account')],
					max_length=100, null=True, unique=True)),
			],
			options={
				'db_table': 'psp_venue_settings',
			},
		),
		migrations.CreateModel(
			name='UserType',
			fields=[
				('id', models.AutoField(
					auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
				('created_date', models.DateTimeField(auto_now=True)),
				('modified_date', models.DateTimeField(auto_now=True)),
				('name', models.CharField(max_length=50)),
				('venues', models.ManyToManyField(
					blank=True, db_constraint=False, related_name='user_types', to='venue.Venue')),
			],
			options={
				'db_table': 'psp_users_type',
			},
		),
		migrations.AddField(
			model_name='usersvenues',
			name='venue',
			field=models.ForeignKey(
				db_column='psp_venue_id', on_delete=django.db.models.deletion.CASCADE,
				to='venue.Venue'),
		),
		migrations.CreateModel(
			name='UsersAdminVenues',
			fields=[
				('id', models.AutoField(
					auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
				('created_date', models.DateTimeField(auto_now=True)),
				('modified_date', models.DateTimeField(auto_now=True)),
				('user', models.ForeignKey(
					db_column='psp_user_id', on_delete=django.db.models.deletion.CASCADE,
					to=settings.AUTH_USER_MODEL)),
				('venue', models.ForeignKey(
					db_column='psp_venue_id', on_delete=django.db.models.deletion.CASCADE,
					to='venue.Venue')),
			],
			options={
				'verbose_name_plural': 'Admin Venues',
				'db_table': 'psp_users_admin_venues',
			},
		),
		migrations.CreateModel(
			name='UserData',
			fields=[
				('id', models.AutoField(
					auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
				('created_date', models.DateTimeField(auto_now=True)),
				('modified_date', models.DateTimeField(auto_now=True)),
				('first_name', models.CharField(blank=True, max_length=100, null=True)),
				('last_name', models.CharField(blank=True, max_length=100, null=True)),
				('mobile', models.CharField(blank=True, max_length=45, null=True)),
				('address1', models.CharField(blank=True, max_length=200, null=True)),
				('address2', models.CharField(blank=True, max_length=200, null=True)),
				('city', models.CharField(blank=True, max_length=100, null=True)),
				('country', models.CharField(blank=True, max_length=100, null=True)),
				('mobile_confirmed', models.BooleanField(default=False)),
				('user', models.OneToOneField(
					db_column='psp_users_id', on_delete=django.db.models.deletion.CASCADE,
					related_name='profile', to=settings.AUTH_USER_MODEL)),
			],
			options={
				'db_table': 'psp_users_data',
			},
		),
		migrations.AddField(
			model_name='user',
			name='admin_venues',
			field=models.ManyToManyField(
				related_name='admin_users', through='venue.UsersAdminVenues', to='venue.Venue'),
		),
		migrations.AddField(
			model_name='user',
			name='groups',
			field=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'),
		),
		migrations.AddField(
			model_name='user',
			name='role',
			field=models.ForeignKey(
				db_column='psp_roles_id', null=True, on_delete=django.db.models.deletion.SET_NULL,
				to='venue.Role'),
		),
		migrations.AddField(
			model_name='user',
			name='user_permissions',
			field=models.ManyToManyField(
				blank=True, help_text='Specific permissions for this user.', to='auth.Permission',
				related_name='user_set', related_query_name='user',
				verbose_name='user permissions'),
		),
		migrations.AddField(
			model_name='user',
			name='user_type',
			field=models.ForeignKey(
				blank=True, db_column='psp_users_type_id', null=True,
				on_delete=django.db.models.deletion.SET_NULL, to='venue.UserType'),
		),
		migrations.AddField(
			model_name='user',
			name='venues',
			field=models.ManyToManyField(through='venue.UsersVenues', to='venue.Venue'),
		),
		migrations.CreateModel(
			name='VenueSettingValue',
			fields=[
				('id', models.AutoField(
					auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
				('created_date', models.DateTimeField(auto_now=True)),
				('modified_date', models.DateTimeField(auto_now=True)),
				('value', models.TextField(blank=True, db_column='psp_value', null=True)),
				('setting', models.ForeignKey(
					db_column='psp_setting_id', on_delete=django.db.models.deletion.CASCADE,
					to='venue.VenueSetting')),
				('venue', models.ForeignKey(
					db_column='psp_venue_id', on_delete=django.db.models.deletion.CASCADE,
					related_name='setting_values', to='venue.Venue')),
			],
			options={
				'db_table': 'psp_venue_settings_values',
				'unique_together': {('venue', 'setting')},
			},
		),
		migrations.AlterUniqueTogether(
			name='usersvenues',
			unique_together={('user', 'venue')},
		),
	]
