From 27f8bf65a94fd720ffbfe2d0fd5a317866df280b Mon Sep 17 00:00:00 2001 From: usmannasir Date: Fri, 19 Sep 2025 11:32:35 +0500 Subject: [PATCH] debian 12 --- install/install.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/install/install.py b/install/install.py index dda808fdd..ecea32afa 100644 --- a/install/install.py +++ b/install/install.py @@ -657,17 +657,7 @@ password="%s" # self.setupVirtualEnv(self.distro) - ### Applying migrations - - os.chdir("/usr/local/CyberCP") - - # Create fresh migrations for all apps - command = "/usr/local/CyberPanel/bin/python manage.py makemigrations" - 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) + ### Database migrations will be handled after database creation if not os.path.exists("/usr/local/CyberCP/public"): os.mkdir("/usr/local/CyberCP/public") @@ -2894,6 +2884,18 @@ def main(): installCyberPanel.Main(cwd, mysql, distro, ent, serial, port, args.ftp, args.powerdns, args.publicip, remotemysql, mysqlhost, mysqldb, mysqluser, mysqlpassword, mysqlport) + # Now that database is created, run Django migrations + preFlightsChecks.stdOut("Running Django migrations...") + os.chdir("/usr/local/CyberCP") + + # Create fresh migrations for all apps + command = "/usr/local/CyberPanel/bin/python manage.py makemigrations" + preFlightsChecks.call(command, distro, command, command, 1, 1, os.EX_OSERR) + + # Apply all migrations + command = "/usr/local/CyberPanel/bin/python manage.py migrate" + preFlightsChecks.call(command, distro, command, command, 1, 1, os.EX_OSERR) + checks.setupPHPAndComposer() checks.fix_selinux_issue() checks.install_psmisc()