From fd5aa069bebc1c91049b27c117c75865632c9548 Mon Sep 17 00:00:00 2001 From: catborise Date: Sat, 3 Oct 2026 12:26:25 +0300 Subject: [PATCH] fix: track migrations; installs apply them instead of generating them The *migrations/* ignore rule is removed. appsettings, computes and logs pin default_auto_field to AutoField, so makemigrations --check reports no pending BigAutoField migrations and existing installs need no schema change. The Vagrant provisioning no longer runs makemigrations, which created install-specific migration files that conflict with the committed history; it only runs migrate. --- .gitignore | 1 - Vagrantfile | 1 - appsettings/apps.py | 1 + computes/apps.py | 6 ++++++ logs/apps.py | 6 ++++++ 5 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 computes/apps.py create mode 100644 logs/apps.py diff --git a/.gitignore b/.gitignore index 2dc1dca6..b5b79530 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,6 @@ console/cert.pem* tags dhcpd.* webvirtcloud/settings.py -*migrations/* .coverage htmlcov *.log diff --git a/Vagrantfile b/Vagrantfile index 51522bb0..ca52857e 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -42,7 +42,6 @@ Vagrant.configure(2) do |config| sudo cp /srv/webvirtcloud/conf/nginx/webvirtcloud.conf /etc/nginx/conf.d sudo cp /srv/webvirtcloud/webvirtcloud/settings.py.template /srv/webvirtcloud/webvirtcloud/settings.py sudo sed "s/SECRET_KEY = ''/SECRET_KEY = '"`python3 /srv/webvirtcloud/conf/runit/secret_generator.py`"'/" -i /srv/webvirtcloud/webvirtcloud/settings.py - python3 /srv/webvirtcloud/manage.py makemigrations python3 /srv/webvirtcloud/manage.py migrate python3 /srv/webvirtcloud/manage.py collectstatic --noinput sudo rm /etc/nginx/sites-enabled/default diff --git a/appsettings/apps.py b/appsettings/apps.py index 2a61fca9..ba36c9a6 100644 --- a/appsettings/apps.py +++ b/appsettings/apps.py @@ -3,3 +3,4 @@ from django.apps import AppConfig class AppsettingsConfig(AppConfig): name = "appsettings" + default_auto_field = "django.db.models.AutoField" diff --git a/computes/apps.py b/computes/apps.py new file mode 100644 index 00000000..de2bbdac --- /dev/null +++ b/computes/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class ComputesConfig(AppConfig): + name = "computes" + default_auto_field = "django.db.models.AutoField" diff --git a/logs/apps.py b/logs/apps.py new file mode 100644 index 00000000..26cf6d68 --- /dev/null +++ b/logs/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class LogsConfig(AppConfig): + name = "logs" + default_auto_field = "django.db.models.AutoField"