From f48bb54607c5b8d225d168a4a6c802f19ef21d66 Mon Sep 17 00:00:00 2001 From: alorig <220087330+alorig@users.noreply.github.com> Date: Tue, 18 Nov 2025 21:22:44 +0500 Subject: [PATCH] 1 --- SITE_BUILDER_AUDIT_REPORT.md | 31 ++++++++++++- .../0002_rename_tenant_to_account.py | 46 +++++++++++++++++++ 2 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 backend/igny8_core/modules/billing/migrations/0002_rename_tenant_to_account.py diff --git a/SITE_BUILDER_AUDIT_REPORT.md b/SITE_BUILDER_AUDIT_REPORT.md index 7650aef6..a608dee2 100644 --- a/SITE_BUILDER_AUDIT_REPORT.md +++ b/SITE_BUILDER_AUDIT_REPORT.md @@ -74,8 +74,19 @@ This audit identifies all requirements, dependencies, and gaps for the Site Buil **Fix Required**: ```bash -# Inside backend container or with access to database -python manage.py migrate site_building +# Step 1: Navigate to app directory +cd /data/app/igny8 + +# Step 2: Create migrations if model changes exist +docker compose -f docker-compose.app.yml -p igny8-app exec igny8_backend python manage.py makemigrations site_building + +# Step 3: Apply migrations +docker compose -f docker-compose.app.yml -p igny8-app exec igny8_backend python manage.py migrate site_building + +# Alternative: If backend is in infra stack, use: +# cd /data/app +# docker compose -f docker-compose.yml -p igny8-infra exec python manage.py makemigrations site_building +# docker compose -f docker-compose.yml -p igny8-infra exec python manage.py migrate site_building ``` **Files Affected**: @@ -115,11 +126,20 @@ python manage.py migrate site_building **Fix Required**: ```bash +# Navigate to app directory +cd /data/app/igny8 + +# Start Celery worker docker compose -f docker-compose.app.yml -p igny8-app up -d igny8_celery_worker + +# Verify it's running +docker compose -f docker-compose.app.yml -p igny8-app ps igny8_celery_worker ``` **Container Configuration**: `docker-compose.app.yml:105-128` +**Note**: If backend is in infra stack, Celery worker may also be there. Check which stack contains the backend service. + --- ### 🟡 **WARNING - Celery Beat Not Running** @@ -129,7 +149,14 @@ docker compose -f docker-compose.app.yml -p igny8-app up -d igny8_celery_worker **Fix Required**: ```bash +# Navigate to app directory +cd /data/app/igny8 + +# Start Celery beat docker compose -f docker-compose.app.yml -p igny8-app up -d igny8_celery_beat + +# Verify it's running +docker compose -f docker-compose.app.yml -p igny8-app ps igny8_celery_beat ``` --- diff --git a/backend/igny8_core/modules/billing/migrations/0002_rename_tenant_to_account.py b/backend/igny8_core/modules/billing/migrations/0002_rename_tenant_to_account.py new file mode 100644 index 00000000..f74241c0 --- /dev/null +++ b/backend/igny8_core/modules/billing/migrations/0002_rename_tenant_to_account.py @@ -0,0 +1,46 @@ +# Generated migration to rename tenant field to account +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('billing', '0001_initial'), + ] + + operations = [ + migrations.RenameField( + model_name='credittransaction', + old_name='tenant', + new_name='account', + ), + migrations.RenameField( + model_name='creditusagelog', + old_name='tenant', + new_name='account', + ), + migrations.AlterField( + model_name='credittransaction', + name='account', + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name='%(class)s_set', + to='igny8_core_auth.account', + db_column='tenant_id', + db_index=True + ), + ), + migrations.AlterField( + model_name='creditusagelog', + name='account', + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name='%(class)s_set', + to='igny8_core_auth.account', + db_column='tenant_id', + db_index=True + ), + ), + ] +