[Django] #27341: Altering max_length on sqlite: makemigrations creates correct migration, but migrate does not alter length of varchar in de database itself

4 views
Skip to first unread message

Django

unread,
Oct 13, 2016, 2:19:55 AM10/13/16
to django-...@googlegroups.com
#27341: Altering max_length on sqlite: makemigrations creates correct migration,
but migrate does not alter length of varchar in de database itself
----------------------------------------------+--------------------
Reporter: gabn88 | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
----------------------------------------------+--------------------
I think the title is self-explanatory.

At my local django installation, changing the max_length of a charfield
did result in the correct migrations (a.k. 0010_autocreated....py), but
migrating the changes to the Sqlite database did not change the varchar in
the database to the new max_length.

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

Django

unread,
Oct 13, 2016, 2:27:53 AM10/13/16
to django-...@googlegroups.com
#27341: Altering max_length on sqlite: makemigrations creates correct migration,
but migrate does not alter length of varchar in de database itself
-------------------------------------+-------------------------------------
Reporter: Gerben Morsink | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.8
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Gerben Morsink):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

I see I've filed a similar bug before: #25866

Would be nice to have it fixed, although I understand it does not have the
highest priority.

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

Django

unread,
Oct 13, 2016, 7:56:58 AM10/13/16
to django-...@googlegroups.com
#27341: Altering max_length on sqlite: makemigrations creates correct migration,
but migrate does not alter length of varchar in de database itself
--------------------------------+--------------------------------------
Reporter: Gerben Morsink | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.8
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 Tim Graham):

* component: Database layer (models, ORM) => Migrations
* easy: 1 => 0


Comment:

Doesn't SQLite [http://www.sqlite.org/faq.html#q9 ignore any size limit on
the column] anyway?

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

Django

unread,
Oct 14, 2016, 11:22:26 AM10/14/16
to django-...@googlegroups.com
#27341: Altering max_length on sqlite: makemigrations creates correct migration,
but migrate does not alter length of varchar in the database itself
--------------------------------+--------------------------------------
Reporter: Gerben Morsink | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 1.8
Severity: Normal | Resolution: worksforme
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 Tim Graham):

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


Comment:

Regardless of my last comment, I see a change from `varchar(200)` to
`varchar(201)` in the "SQLite Database Browser" program after changing the
length of `CharField` and running the migration. Please reopen if you can
provide steps on how to reproduce.

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

Reply all
Reply to author
Forward
0 new messages