debian 12

This commit is contained in:
usmannasir
2025-09-19 09:40:01 +05:00
parent 2f297029d0
commit 212bf53932
2 changed files with 5 additions and 60 deletions

View File

@@ -1,32 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2024-01-01 00:00
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('baseTemplate', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='UserNotificationPreferences',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('backup_notification_dismissed', models.BooleanField(default=False, help_text='Whether user has dismissed the backup notification')),
('ai_scanner_notification_dismissed', models.BooleanField(default=False, help_text='Whether user has dismissed the AI scanner notification')),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='notification_preferences', to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name': 'User Notification Preferences',
'verbose_name_plural': 'User Notification Preferences',
},
),
]

View File

@@ -661,36 +661,13 @@ password="%s"
os.chdir("/usr/local/CyberCP")
# Try makemigrations first
# Create fresh migrations for all apps
command = "/usr/local/CyberPanel/bin/python manage.py makemigrations"
result = preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
# If makemigrations fails due to migration dependency issues, try to fix it
if result != 1:
preFlightsChecks.stdOut("Migration dependency issue detected, attempting to fix...")
# Reset baseTemplate migrations to resolve dependency issues
command = "/usr/local/CyberPanel/bin/python manage.py migrate baseTemplate zero --fake"
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
# Create a new initial migration for baseTemplate
command = "/usr/local/CyberPanel/bin/python manage.py makemigrations baseTemplate --empty"
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
# Try makemigrations again
command = "/usr/local/CyberPanel/bin/python manage.py makemigrations"
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
##
# Apply migrations with fake-initial to handle missing initial migrations
command = "/usr/local/CyberPanel/bin/python manage.py migrate --fake-initial"
result = preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
# If fake-initial fails, try regular migrate
if result != 1:
command = "/usr/local/CyberPanel/bin/python manage.py migrate"
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
# Apply all migrations
command = "/usr/local/CyberPanel/bin/python manage.py migrate"
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
if not os.path.exists("/usr/local/CyberCP/public"):
os.mkdir("/usr/local/CyberCP/public")