Re: Changing the type from Boolean to Integer on SQLite

2016-01-22 Thread Mike Bayer
On 01/22/2016 10:20 AM, Michal Petrucha wrote: > On Fri, Jan 22, 2016 at 09:59:39AM -0500, Mike Bayer wrote: >> I see in >> >> batch_op.alter_column(name, type_=sa.Integer(), >> existing_type=sa.Boolean()) >> >> you aren't giving it the constraint name in the existing_type, >> that's actually

Re: Changing the type from Boolean to Integer on SQLite

2016-01-22 Thread Michal Petrucha
On Fri, Jan 22, 2016 at 09:59:39AM -0500, Mike Bayer wrote: > I see in > > batch_op.alter_column(name, type_=sa.Integer(), > existing_type=sa.Boolean()) > > you aren't giving it the constraint name in the existing_type, that's > actually where the > "_unnamed_" is coming from. Yeah, I've be

Re: Changing the type from Boolean to Integer on SQLite

2016-01-22 Thread Mike Bayer
resending because my PGP tools totally got in the way On 01/22/2016 09:05 AM, Michal Petrucha wrote: > On Fri, Jan 22, 2016 at 01:44:38PM +0100, Michal Petrucha wrote: >> Can anyone help me come up with the best way of renaming a Boolean >> column on both backends? I'm about to try creating a new

Re: Changing the type from Boolean to Integer on SQLite

2016-01-22 Thread Mike Bayer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 01/22/2016 07:44 AM, Michal Petrucha wrote: > Hello people, > > I'm having difficluty changing the type of a column from Boolean > to Integer on SQLite. Boolean generates an integer column with a > CHECK constraint; changing the type should jus

Re: Changing the type from Boolean to Integer on SQLite

2016-01-22 Thread Michal Petrucha
On Fri, Jan 22, 2016 at 01:44:38PM +0100, Michal Petrucha wrote: > Can anyone help me come up with the best way of renaming a Boolean > column on both backends? I'm about to try creating a new column with > the new name, copying the data from the old column, and dropping the > old one, but that's a

Changing the type from Boolean to Integer on SQLite

2016-01-22 Thread Michal Petrucha
Hello people, I'm having difficluty changing the type of a column from Boolean to Integer on SQLite. Boolean generates an integer column with a CHECK constraint; changing the type should just drop the constraint (on SQLite at least). The problem is, when batch_op processes a command like this: