﻿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
28633	Migrate BooleanField to IntegerField	Dmitriy Sintsov	nobody	"It should be quite trivial and obvious that False is replaced to 0, while True to 1. However SQLMIGRATE generated code

{{{
ALTER TABLE ""isp_user_profile"" ALTER COLUMN ""is_filled"" TYPE integer;
}}}

produces the following PostgreSQL error:

{{{
django.db.utils.ProgrammingError: column ""is_filled"" cannot be cast automatically to type integer
HINT:  You might need to specify ""USING is_filled::integer"".
}}}

Why USING statement is not generated automatically?

The workaround is to create RunSQL migration manually, but it would be much more convenient to have correct SQL code generated automatically.

There is no data loss in direct conversion from boolean to integer."	Uncategorized	closed	Migrations	1.8	Normal	duplicate			Unreviewed	0	0	0	0	0	0
