[Django] #28785: Tracking migrations

Visto 10 veces
Saltar al primer mensaje no leído

Django

no leída,
7 nov 2017, 22:50:407/11/17
a django-...@googlegroups.com
#28785: Tracking migrations
-----------------------------------------+------------------------
Reporter: Ramez Kabbani | Owner: nobody
Type: Uncategorized | Status: new
Component: Migrations | Version: 1.11
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 |
-----------------------------------------+------------------------
Migrations exist in django in two locations:
1. In the codebase under app_name/migrations
2. As a db entry in django_migrations

I've come across the following scenario where I expected Django to give an
error but it didn't not.

Assume we have 4 migrations for an app, and migration 1 through 3 are
applied.


{{{
# Content of Postgres DB

32 | app_name | 0001_initial
33 | app_name | 0002_migration2
34 | app_name | 0003_migration3
}}}

All migrations except 0001_initial.py were deleted including the folder
pycache. We then run makemigrations


{{{
# Contents of migration folder after makemigrations was ran.

0001_initial.py 0002_name.py __init__.py __pycache__

# Run makemigrations
No Changes Detected

# Output of showmigrations

app_name
[X] 0001_initial
[X] 0002_name
}}}

Contents of Postgres django_migrations, however, remain unchanged still
with an entry for a third migration. I expected an error in one of the
following commands but received none: makemigrations, migrate,
showmigrations.

Also, migrate --fake app_name 0002_name does not lead to the deletion of
0003_migration3 entry in django_migrations

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

Django

no leída,
8 nov 2017, 5:07:378/11/17
a django-...@googlegroups.com
#28785: Tracking migrations
-------------------------------+------------------------------------

Reporter: Ramez Kabbani | Owner: nobody
Type: New feature | Status: new
Component: Migrations | Version: 1.11
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by Tomer Chachamu):

* type: Uncategorized => New feature
* stage: Unreviewed => Accepted


Comment:

Agreed that a warning or system check for this situation would be nice.
However, the docs currently suggest a way to turn a squashed migration
into a normal migration, and it looks like any database that has had this
done will then fail the system check. So, we would need:

* A way to turn squashed migrations into normal migrations in the future
that does not cause the system check to fail,
* A solution for old databases to "reset" the system check, or we can just
recommend people add it to `SILENCED_SYSTEM_CHECKS` (which would be a bit
of a shame)

At the least, there might be a good place in the documentation to add a
warning that migration files should not be removed.

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

Django

no leída,
9 nov 2017, 10:00:359/11/17
a django-...@googlegroups.com
#28785: Tracking migrations
-------------------------------+--------------------------------------
Reporter: Ramez Kabbani | Owner: Sonu kumar
Type: New feature | Status: assigned
Component: Migrations | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Sonu kumar):

* status: new => assigned
* owner: nobody => Sonu kumar


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

Django

no leída,
28 dic 2017, 13:37:5628/12/17
a django-...@googlegroups.com
#28785: Tracking migrations
-------------------------------+--------------------------------------
Reporter: Ramez Kabbani | Owner: Sonu kumar
Type: New feature | Status: assigned
Component: Migrations | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Tim Graham):

* needs_better_patch: 0 => 1
* has_patch: 0 => 1


Comment:

A [https://github.com/django/django/pull/9339 PR] adds a check to
makemigrations. It still needs some improvement.

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

Django

no leída,
10 abr 2021, 6:14:3310/4/21
a django-...@googlegroups.com
#28785: Tracking migrations
-------------------------------+-----------------------------------------
Reporter: Ramez Kabbani | Owner: Manav Agarwal

Type: New feature | Status: assigned
Component: Migrations | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------+-----------------------------------------
Changes (by Manav Agarwal):

* owner: Sonu kumar => Manav Agarwal


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

Django

no leída,
10 abr 2021, 7:29:2010/4/21
a django-...@googlegroups.com
#28785: Tracking migrations
-------------------------------+-----------------------------------------
Reporter: Ramez Kabbani | Owner: Manav Agarwal
Type: New feature | Status: assigned
Component: Migrations | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+-----------------------------------------
Changes (by Manav Agarwal):

* needs_better_patch: 1 => 0


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

Django

no leída,
8 jun 2021, 4:22:178/6/21
a django-...@googlegroups.com
#28785: Tracking migrations
-------------------------------+-----------------------------------------
Reporter: Ramez Kabbani | Owner: Manav Agarwal
Type: New feature | Status: assigned
Component: Migrations | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------+-----------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1

* needs_tests: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/28785#comment:6>

Django

no leída,
13 abr 2022, 11:15:0713/4/22
a django-...@googlegroups.com
#28785: Tracking migrations
-------------------------------+------------------------------------
Reporter: Ramez Kabbani | Owner: uzaxirr

Type: New feature | Status: assigned
Component: Migrations | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by uzaxirr):

* owner: Manav Agarwal => uzaxirr


--
Ticket URL: <https://code.djangoproject.com/ticket/28785#comment:7>

Django

no leída,
1 may 2022, 7:10:101/5/22
a django-...@googlegroups.com
#28785: Tracking migrations
-------------------------------+-----------------------------------------
Reporter: Ramez Kabbani | Owner: Abhinav Yadav

Type: New feature | Status: assigned
Component: Migrations | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------+-----------------------------------------
Changes (by Abhinav Yadav):

* owner: Uzair Ali => Abhinav Yadav


--
Ticket URL: <https://code.djangoproject.com/ticket/28785#comment:8>

Django

no leída,
28 jun 2022, 17:49:4128/6/22
a django-...@googlegroups.com
#28785: Tracking migrations
-------------------------------+-----------------------------------------
Reporter: Ramez Kabbani | Owner: Abhinav Yadav
Type: New feature | Status: assigned
Component: Migrations | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------+-----------------------------------------

Comment (by Adam Johnson):

#26760 added the `--prune` option to `migrate`, to clear up stale entries
from `django_migrations`. Perhaps we no longer need to add a warning now
there's this option.

--
Ticket URL: <https://code.djangoproject.com/ticket/28785#comment:9>

Django

no leída,
29 jun 2022, 5:08:4129/6/22
a django-...@googlegroups.com
#28785: Tracking migrations
-------------------------------+-----------------------------------------
Reporter: Ramez Kabbani | Owner: Abhinav Yadav
Type: New feature | Status: closed
Component: Migrations | Version: 1.11
Severity: Normal | Resolution: wontfix

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------+-----------------------------------------
Changes (by Carlton Gibson):

* status: assigned => closed
* resolution: => wontfix


Comment:

Agreed, good spot Adam.

Let's mark as wontfix given the `--prune` option, and the difficulty so
far in providing an appropriate patch. (If future-someone wants to re-open
with a PR for whatever is considered missing then that would be OK.)

--
Ticket URL: <https://code.djangoproject.com/ticket/28785#comment:10>

Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos