[Django] #34926: Missing model after squashing

1 view
Skip to first unread message

Django

unread,
Oct 24, 2023, 1:12:53 PM10/24/23
to django-...@googlegroups.com
#34926: Missing model after squashing
----------------------------------------------+------------------------
Reporter: Sebastian Jekutsch | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 4.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
----------------------------------------------+------------------------
Sorry for an unspecific subject and not searching for duplicates due to
lack of knowledge, understanding and time.

As an excerpt from #34924 which has been correctly closed as duplicate for
two of its issues, the third one remains unresolved, as far as I see. I
reopen it with this new report.

Based on the attachments
1. Zip of single migrations 0001 to 0116
2. Resulting squashed migration file of "manage.py squashmigrations
knowledgebase 0116"
3. models.py at the end of 0116
I found that model Activity has errorneously disappeared completely in the
squashed migration file. It has even not been detected by a new
makemigrations run for cross-check.

--
Ticket URL: <https://code.djangoproject.com/ticket/34926>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 24, 2023, 1:15:05 PM10/24/23
to django-...@googlegroups.com
#34926: Missing model after squashing
------------------------------------+--------------------------------------

Reporter: Sebastian Jekutsch | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 4.2
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+--------------------------------------
Description changed by Sebastian Jekutsch:

Old description:

> Sorry for an unspecific subject and not searching for duplicates due to
> lack of knowledge, understanding and time.
>
> As an excerpt from #34924 which has been correctly closed as duplicate
> for two of its issues, the third one remains unresolved, as far as I see.
> I reopen it with this new report.
>
> Based on the attachments
> 1. Zip of single migrations 0001 to 0116
> 2. Resulting squashed migration file of "manage.py squashmigrations
> knowledgebase 0116"
> 3. models.py at the end of 0116
> I found that model Activity has errorneously disappeared completely in
> the squashed migration file. It has even not been detected by a new
> makemigrations run for cross-check.

New description:

Sorry for an unspecific subject and not searching for duplicates due to
lack of knowledge, understanding and time.

As an excerpt from #34924 which has been correctly closed as duplicate for
two of its issues, the third one remains unresolved, as far as I see. I
reopen it with this new report.

Based on the attachments
1. Zip of single migrations 0001 to 0116
2. Resulting squashed migration file of "manage.py squashmigrations
knowledgebase 0116"
3. models.py at the end of 0116

within #34924,


I found that model Activity has errorneously disappeared completely in the
squashed migration file. It has even not been detected by a new
makemigrations run for cross-check.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/34926#comment:1>

Django

unread,
Oct 24, 2023, 2:06:50 PM10/24/23
to django-...@googlegroups.com
#34926: Missing model after squashing
------------------------------------+--------------------------------------
Reporter: Sebastian Jekutsch | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 4.2
Severity: Normal | Resolution: invalid

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => invalid


Comment:

`Activity` is in the squashed migration.

--
Ticket URL: <https://code.djangoproject.com/ticket/34926#comment:2>

Django

unread,
Oct 24, 2023, 4:16:01 PM10/24/23
to django-...@googlegroups.com
#34926: Missing model after squashing
------------------------------------+--------------------------------------
Reporter: Sebastian Jekutsch | Owner: nobody
Type: Bug | Status: new

Component: Migrations | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+--------------------------------------
Changes (by Sebastian Jekutsch):

* status: closed => new
* resolution: invalid =>


Comment:

Right, but it's below its first reference in model Topic within the
script, so an initial database migration will raise an "ValueError:
Related model 'knowledgebase.activity' cannot be resolved".
(Apologize for not stating the problem more specific.)

--
Ticket URL: <https://code.djangoproject.com/ticket/34926#comment:3>

Django

unread,
Oct 24, 2023, 4:28:33 PM10/24/23
to django-...@googlegroups.com
#34926: Missing model after squashing
------------------------------------+--------------------------------------
Reporter: Sebastian Jekutsch | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+--------------------------------------

Comment (by Mariusz Felisiak):

Replying to [comment:3 Sebastian Jekutsch]:


> Right, but it's below its first reference in model Topic within the
script, so an initial database migration will raise an "ValueError:
Related model 'knowledgebase.activity' cannot be resolved".
> (Apologize for not stating the problem more specific.)

That is also not true:
{{{
migrations.CreateModel(
name="Activity",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=50)),
(
"members",
models.ManyToManyField(
blank=True,
related_name="memberships",
to="knowledgebase.activity",
),
),
("alternative_names", models.CharField(blank=True,
max_length=250)),
],
options={
"verbose_name": "Activity",
"verbose_name_plural": "Activities",
"ordering":
[django.db.models.functions.text.Lower("name")],
},
),
migrations.AddField(
model_name="topic",
name="activities",
field=models.ManyToManyField(
blank=True, related_name="activities",
to="knowledgebase.activity"
),
),
}}}

Please see TicketClosingReasons/UseSupportChannels for ways to get help
and don't use Trac as a support channel.

--
Ticket URL: <https://code.djangoproject.com/ticket/34926#comment:4>

Django

unread,
Oct 24, 2023, 4:46:32 PM10/24/23
to django-...@googlegroups.com
#34926: Missing model after squashing
------------------------------------+--------------------------------------
Reporter: Sebastian Jekutsch | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 4.2
Severity: Normal | Resolution: invalid

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+--------------------------------------
Changes (by Sebastian Jekutsch):

* status: new => closed
* resolution: => invalid


Comment:

Ok, seems I have differences locally.

--
Ticket URL: <https://code.djangoproject.com/ticket/34926#comment:5>

Reply all
Reply to author
Forward
0 new messages