From 97410a31dfc5b6fa80faa67f3bf77984d6146d0f Mon Sep 17 00:00:00 2001 From: chaechaeis <104643208+chaechaeis@users.noreply.github.com> Date: Sat, 6 Apr 2024 15:51:54 +0900 Subject: [PATCH] #31 fix : modify migrations and image upload (#32) * #23 feat : modify products * #31 fix : additional modify migration --- UpcyProject/settings.py | 1 - ...07_category_fit_style_texture_product_category_and_more.py | 2 +- products/migrations/0008_alter_product_category.py | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/UpcyProject/settings.py b/UpcyProject/settings.py index 4c4cdda..abae5fe 100644 --- a/UpcyProject/settings.py +++ b/UpcyProject/settings.py @@ -18,7 +18,6 @@ # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent env = environ.Env(DEBUG=(bool, False)) - # env_file = os.path.join(BASE_DIR, '.env') # if os.path.exists(env_file): # environ.Env.read_env( diff --git a/products/migrations/0007_category_fit_style_texture_product_category_and_more.py b/products/migrations/0007_category_fit_style_texture_product_category_and_more.py index 63cdeff..d74490e 100644 --- a/products/migrations/0007_category_fit_style_texture_product_category_and_more.py +++ b/products/migrations/0007_category_fit_style_texture_product_category_and_more.py @@ -42,7 +42,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='product', name='category', - field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='products', to='products.category'), + field=models.ForeignKey(blank=False, null=False, on_delete=django.db.models.deletion.CASCADE, related_name='products', to='products.category'), preserve_default=False, ), migrations.AddField( diff --git a/products/migrations/0008_alter_product_category.py b/products/migrations/0008_alter_product_category.py index e54e9d3..7a1ee01 100644 --- a/products/migrations/0008_alter_product_category.py +++ b/products/migrations/0008_alter_product_category.py @@ -14,6 +14,6 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='product', name='category', - field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='products', to='products.category'), - ), + field=models.ForeignKey(blank=False, null=False, on_delete=django.db.models.deletion.CASCADE, related_name='products', to='products.category'), + ), # 여기 수정해야할 수도 있음 ]