﻿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	nobody	"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;
}}}
"	Uncategorized	new	Uncategorized	1.8	Normal				Unreviewed	0	0	0	0	0	0
