From a4db73e4cd9948142a13cda5211d2a8037da04c1 Mon Sep 17 00:00:00 2001 From: Edouard Date: Mon, 28 Jul 2025 19:51:20 +0200 Subject: [PATCH 1/3] Add migration to alter template ID field to BigAutoField (#157) --- .../migrations/0003_alter_template_id.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 dbtemplates/migrations/0003_alter_template_id.py diff --git a/dbtemplates/migrations/0003_alter_template_id.py b/dbtemplates/migrations/0003_alter_template_id.py new file mode 100644 index 0000000..4b72432 --- /dev/null +++ b/dbtemplates/migrations/0003_alter_template_id.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.23 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('dbtemplates', '0002_alter_template_creation_date_and_more'), + ] + + operations = [ + migrations.AlterField( + model_name='template', + name='id', + field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), + ), + ] \ No newline at end of file From 808e6b527a4dfde76b4778a116d5dfd527d5e44d Mon Sep 17 00:00:00 2001 From: Edouard Date: Mon, 28 Jul 2025 19:57:26 +0200 Subject: [PATCH 2/3] Update Template model to use BigAutoField for ID and remove obsolete migration (#157) --- .../migrations/0003_alter_template_id.py | 18 ------------------ dbtemplates/models.py | 4 ++-- 2 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 dbtemplates/migrations/0003_alter_template_id.py diff --git a/dbtemplates/migrations/0003_alter_template_id.py b/dbtemplates/migrations/0003_alter_template_id.py deleted file mode 100644 index 4b72432..0000000 --- a/dbtemplates/migrations/0003_alter_template_id.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 4.2.23 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('dbtemplates', '0002_alter_template_creation_date_and_more'), - ] - - operations = [ - migrations.AlterField( - model_name='template', - name='id', - field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), - ), - ] \ No newline at end of file diff --git a/dbtemplates/models.py b/dbtemplates/models.py index aa87dcb..931fbf0 100644 --- a/dbtemplates/models.py +++ b/dbtemplates/models.py @@ -18,8 +18,8 @@ class Template(models.Model): Defines a template model for use with the database template loader. The field ``name`` is the equivalent to the filename of a static template. """ - id = models.AutoField(primary_key=True, verbose_name=_('ID'), - serialize=False, auto_created=True) + id = models.BigAutoField(primary_key=True, verbose_name=_('ID'), + serialize=False, auto_created=True) name = models.CharField(_('name'), max_length=100, help_text=_("Example: 'flatpages/default.html'")) content = models.TextField(_('content'), blank=True) From 1b3a0f6ac0290e4985fd5a6832103fd65863fbfb Mon Sep 17 00:00:00 2001 From: Edouard Date: Mon, 28 Jul 2025 20:34:54 +0200 Subject: [PATCH 3/3] Add migration to alter template ID field to BigAutoField --- .../migrations/0003_alter_template_id.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 dbtemplates/migrations/0003_alter_template_id.py diff --git a/dbtemplates/migrations/0003_alter_template_id.py b/dbtemplates/migrations/0003_alter_template_id.py new file mode 100644 index 0000000..6b95a36 --- /dev/null +++ b/dbtemplates/migrations/0003_alter_template_id.py @@ -0,0 +1,20 @@ +# Generated by Django 4.2.23 on 2025-07-28 13:34 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("dbtemplates", "0002_alter_template_creation_date_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="template", + name="id", + field=models.BigAutoField( + auto_created=True, primary_key=True, serialize=False, verbose_name="ID" + ), + ), + ]