McDuck/users/migrations/0001_initial.py

124 lines
8.3 KiB
Python
Raw Permalink Normal View History

2024-08-29 09:21:58 +00:00
# Generated by Django 5.0.6 on 2024-08-26 11:43
import django.contrib.auth.models
import django.contrib.auth.validators
import django.db.models.deletion
import django.utils.timezone
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='DailyRewardsList',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('active_day', models.IntegerField(blank=True, verbose_name='Активный день')),
('month_max_day', models.CharField(choices=[('До 28', 'До 28'), ('До 29', 'До 29'), ('До 30', 'До 30'), ('До 31', 'До 31')], max_length=250, verbose_name='Длительность месяца')),
],
options={
'verbose_name': 'Список наград',
'verbose_name_plural': 'Список наград',
},
),
migrations.CreateModel(
name='User',
fields=[
('id', models.BigAutoField(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')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
('photo', models.ImageField(upload_to='static/media/user_photo/', verbose_name='Аватарка пользователя')),
('tg_id', models.CharField(blank=True, max_length=250, verbose_name='Telegram ID')),
('tg_username', models.CharField(blank=True, max_length=250, verbose_name='Имя пользователя')),
('name', models.CharField(blank=True, max_length=300, verbose_name='Имя')),
('referral_code', models.CharField(blank=True, max_length=250, null=True, unique=True, verbose_name='Код рефферала')),
('coins_for_referral', models.BigIntegerField(blank=True, default=0, verbose_name='Монеты полученные от рефералов')),
('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')),
('referred_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='referrals', to=settings.AUTH_USER_MODEL)),
('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')),
],
options={
'verbose_name': 'user',
'verbose_name_plural': 'users',
'abstract': False,
},
managers=[
('objects', django.contrib.auth.models.UserManager()),
],
),
migrations.CreateModel(
name='Balance',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(verbose_name='Имя баланса')),
('wallet', models.CharField(blank=True, max_length=350, null=True, verbose_name='Кошелек')),
('currency', models.CharField(blank=True, max_length=250, verbose_name='Валюта')),
('balance', models.BigIntegerField(default=0, verbose_name='Количество монет/Сумма')),
('color', models.CharField(choices=[('Yl', 'Yellow'), ('BK', 'Black'), ('GR', 'Grey'), ('BL', 'Blue')], default='Yl', max_length=250, verbose_name='Цвет')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name': 'Баланс пользователя',
'verbose_name_plural': 'Балансы пользователей',
},
),
migrations.CreateModel(
name='DailyReward',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('day', models.IntegerField(verbose_name='День')),
('reward_amount', models.IntegerField(verbose_name='Сумма награды')),
('claimed', models.BooleanField(default=False, verbose_name='Была ли награда получена')),
('claim_date', models.DateTimeField(blank=True, null=True, verbose_name='Время получения награды')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name': 'Ежедневная награда',
'verbose_name_plural': 'Ежедневные награды',
},
),
migrations.CreateModel(
name='Levels',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(blank=True, max_length=300, verbose_name='Имя')),
('level', models.IntegerField(verbose_name='Уровень')),
('photo', models.ImageField(upload_to='static/media/levels/', verbose_name='Фото уровня')),
('need_coins', models.IntegerField(verbose_name='Количество нужных монет')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name': 'Уровень',
'verbose_name_plural': 'Уровни',
},
),
migrations.CreateModel(
name='Transaction',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('amount', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Сумма')),
('currency', models.CharField(max_length=10, verbose_name='Валюта')),
('status', models.CharField(default='Pending', max_length=50, verbose_name='Статус')),
('transaction_id', models.CharField(max_length=100, unique=True, verbose_name='ID транзакции')),
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Дата создания')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]