Добавлены миграции

main
through-your-tears 9 months ago
parent 972359c931
commit 4152b46845

@ -0,0 +1,52 @@
# Generated by Django 5.0.4 on 2024-04-06 17:09
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Bonus',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('amount', models.IntegerField()),
('descr', models.TextField()),
],
),
migrations.CreateModel(
name='FavouriteOrganization',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
],
),
migrations.CreateModel(
name='Photo',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('image', models.ImageField(upload_to='users/photos/')),
],
),
migrations.CreateModel(
name='Question',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=64)),
('image', models.ImageField(upload_to='images/tests/')),
],
),
migrations.CreateModel(
name='Test',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=64)),
('image', models.ImageField(upload_to='images/tests/')),
('reward', models.PositiveIntegerField()),
],
),
]

@ -0,0 +1,39 @@
# Generated by Django 5.0.4 on 2024-04-06 17:09
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('activities', '0001_initial'),
('organizations', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.AddField(
model_name='bonus',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='favouriteorganization',
name='organization',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='organizations.organization'),
),
migrations.AddField(
model_name='favouriteorganization',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='photo',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='gallery', to=settings.AUTH_USER_MODEL),
),
]

@ -0,0 +1,78 @@
# Generated by Django 5.0.4 on 2024-04-06 17:09
import datetime
import django.db.models.deletion
import jwtauth.managers
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='Friend',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('approved', models.BooleanField(default=False)),
],
),
migrations.CreateModel(
name='CustomUser',
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')),
('email', models.EmailField(max_length=254, unique=True, verbose_name='email')),
('is_staff', models.BooleanField(default=False, verbose_name='Administrator')),
('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')),
],
options={
'verbose_name': 'User',
'verbose_name_plural': 'Users',
},
managers=[
('objects', jwtauth.managers.CustomUserManager()),
],
),
migrations.CreateModel(
name='Profile',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('first_name', models.CharField(blank=True, default='', max_length=32)),
('last_name', models.CharField(blank=True, default='', max_length=32)),
('title', models.CharField(blank=True, default='', max_length=32)),
('avatar', models.ImageField(blank=True, default=None, null=True, upload_to='avatar/')),
('friends', models.ManyToManyField(blank=True, through='jwtauth.Friend', to='jwtauth.profile')),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.AddField(
model_name='friend',
name='first',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='first_friend', to='jwtauth.profile'),
),
migrations.AddField(
model_name='friend',
name='second',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='second_friend', to='jwtauth.profile'),
),
migrations.CreateModel(
name='RefreshToken',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('token', models.CharField(max_length=255)),
('expires', models.DateTimeField(default=datetime.datetime.now)),
('used', models.BooleanField(default=False)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]

@ -0,0 +1,68 @@
# Generated by Django 5.0.4 on 2024-04-06 17:09
import django.contrib.gis.db.models.fields
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=64)),
('icon', models.ImageField(upload_to='icons/category/')),
],
),
migrations.CreateModel(
name='Location',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('coords', django.contrib.gis.db.models.fields.PointField(db_index=True, srid=4326)),
('address', models.CharField(blank=True, max_length=512, null=True)),
],
),
migrations.CreateModel(
name='Region',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('code', models.PositiveIntegerField()),
('name', models.CharField(max_length=64)),
],
),
migrations.CreateModel(
name='Organization',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=256)),
('phone', models.CharField(max_length=20)),
('website', models.URLField()),
('description', models.TextField()),
('category', models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, to='organizations.category')),
('location', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='organizations.location')),
('owner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='OrganizationImage',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('image', models.ImageField(upload_to='images/organizations')),
('organization', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='organization_images', to='organizations.organization')),
],
),
migrations.AddField(
model_name='location',
name='region',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='organizations.region'),
),
]
Loading…
Cancel
Save