From 5dc32e32c00060035c765d4e2b457f97a8f61a70 Mon Sep 17 00:00:00 2001 From: through-your-tears Date: Sat, 6 Apr 2024 21:07:13 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=BC=D0=B8=D0=B3=D1=80=D0=B0=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/activities/migrations/0001_initial.py | 35 ++++++++++++++++ src/activities/migrations/0002_initial.py | 39 ++++++++++++++++++ src/activities/models.py | 5 --- src/jwtauth/migrations/0001_initial.py | 2 +- src/organizations/migrations/0001_initial.py | 12 +++--- ...alter_organization_description_and_more.py | 41 ------------------- 6 files changed, 81 insertions(+), 53 deletions(-) create mode 100644 src/activities/migrations/0001_initial.py create mode 100644 src/activities/migrations/0002_initial.py delete mode 100644 src/organizations/migrations/0002_alter_organization_description_and_more.py diff --git a/src/activities/migrations/0001_initial.py b/src/activities/migrations/0001_initial.py new file mode 100644 index 0000000..e040bec --- /dev/null +++ b/src/activities/migrations/0001_initial.py @@ -0,0 +1,35 @@ +# Generated by Django 5.0.4 on 2024-04-06 18:04 + +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/')), + ], + ), + ] diff --git a/src/activities/migrations/0002_initial.py b/src/activities/migrations/0002_initial.py new file mode 100644 index 0000000..94e4e42 --- /dev/null +++ b/src/activities/migrations/0002_initial.py @@ -0,0 +1,39 @@ +# Generated by Django 5.0.4 on 2024-04-06 18:04 + +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), + ), + ] diff --git a/src/activities/models.py b/src/activities/models.py index ec9f01a..fef7d02 100644 --- a/src/activities/models.py +++ b/src/activities/models.py @@ -14,11 +14,6 @@ class FavouriteOrganization(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) -class Test(models.Model): - title = models.CharField(max_length=64) - image = models.ImageField(upload_to='images/tests/') - - class Bonus(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) amount = models.IntegerField() diff --git a/src/jwtauth/migrations/0001_initial.py b/src/jwtauth/migrations/0001_initial.py index 73fb00c..cd9ea2b 100644 --- a/src/jwtauth/migrations/0001_initial.py +++ b/src/jwtauth/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 5.0.4 on 2024-04-06 17:09 +# Generated by Django 5.0.4 on 2024-04-06 18:04 import datetime import django.db.models.deletion diff --git a/src/organizations/migrations/0001_initial.py b/src/organizations/migrations/0001_initial.py index d579e79..6dfeb93 100644 --- a/src/organizations/migrations/0001_initial.py +++ b/src/organizations/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 5.0.4 on 2024-04-06 17:09 +# Generated by Django 5.0.4 on 2024-04-06 18:04 import django.contrib.gis.db.models.fields import django.db.models.deletion @@ -43,13 +43,13 @@ class Migration(migrations.Migration): 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()), + ('name', models.CharField(blank=True, max_length=256)), + ('phone', models.CharField(blank=True, max_length=20)), + ('website', models.URLField(blank=True)), + ('description', models.TextField(blank=True)), ('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)), + ('owner', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)), ], ), migrations.CreateModel( diff --git a/src/organizations/migrations/0002_alter_organization_description_and_more.py b/src/organizations/migrations/0002_alter_organization_description_and_more.py deleted file mode 100644 index 7b7edeb..0000000 --- a/src/organizations/migrations/0002_alter_organization_description_and_more.py +++ /dev/null @@ -1,41 +0,0 @@ -# Generated by Django 5.0.4 on 2024-04-06 17:44 - -import django.db.models.deletion -from django.conf import settings -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('organizations', '0001_initial'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ] - - operations = [ - migrations.AlterField( - model_name='organization', - name='description', - field=models.TextField(blank=True), - ), - migrations.AlterField( - model_name='organization', - name='name', - field=models.CharField(blank=True, max_length=256), - ), - migrations.AlterField( - model_name='organization', - name='owner', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL), - ), - migrations.AlterField( - model_name='organization', - name='phone', - field=models.CharField(blank=True, max_length=20), - ), - migrations.AlterField( - model_name='organization', - name='website', - field=models.URLField(blank=True), - ), - ]