﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
25002	Postgresql migration fails when changing a CharField to a TimeField	Dirk Uys	Simon Charette	"The code from the migration is as follows:

{{{#!python
migrations.AlterField(
    model_name='studygroup',
    name='time',
    field=models.TimeField(),
),
}}}

The field used to be a models.CharField()

The error follows:

{{{
django.db.utils.ProgrammingError: column ""time"" cannot be cast automatically to type time without time zone
HINT:  Specify a USING expression to perform the conversion
}}}

I can manually fix this using SQL:

{{{
ALTER TABLE ""studygroups_studygroup"" ALTER COLUMN ""time"" TYPE time USING ""time""::time;
}}}

I don't have code with the problem isolated, but this project shows the problem when configured to use postgres. http://github.com/p2pu/knight-app/."	Bug	closed	Migrations	dev	Normal	fixed	migrations		Ready for checkin	1	0	0	0	0	0
