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 , 8 years ago
comment:2 by , 8 years ago
Component: | Database layer (models, ORM) → Migrations |
---|---|
Easy pickings: | unset |
Doesn't SQLite ignore any size limit on the column anyway?
comment:3 by , 8 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Summary: | Altering max_length on sqlite: makemigrations creates correct migration, but migrate does not alter length of varchar in de database itself → Altering 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.
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.