Opened 8 years ago

Closed 8 years ago

#27341 closed Bug (worksforme)

Altering max_length on sqlite: makemigrations creates correct migration, but migrate does not alter length of varchar in the database itself

Reported by: Gerben Morsink Owned by: nobody
Component: Migrations Version: 1.8
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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.

Change History (3)

comment:1 by Gerben Morsink, 8 years ago

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.

comment:2 by Tim Graham, 8 years ago

Component: Database layer (models, ORM)Migrations
Easy pickings: unset

comment:3 by Tim Graham, 8 years ago

Resolution: worksforme
Status: newclosed
Summary: Altering max_length on sqlite: makemigrations creates correct migration, but migrate does not alter length of varchar in de database itselfAltering max_length on sqlite: makemigrations creates correct migration, but migrate does not alter length of varchar in the database itself

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.

Note: See TracTickets for help on using tickets.
Back to Top