Re: [SQLObject] Altering a (populated) database column
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2017-10-24 20:00:01
|
Hi! On Tue, Oct 24, 2017 at 08:00:13PM +0100, Hugo Mills <hu...@ni...> wrote: > Is there any way that I can modify an existing database column, > with data in it, without losing the data in it? All I need to be able > to do is increase the size of a StringCol. > > I can see addColumn and delColumn methods of the sqlmeta object, > but not an alterColumn or anything similar. Probably yes (depends on the backend) but not with SQLObject. SQLObject can CREATE/DROP tables, columns and indices but cannot ALTER them. You need to execute ALTER TABLE connecting directly or call connection.execute("ALTER TABLE ...") What us your backend? MySQL? > Thanks, > Hugo. > > -- > Dr Hugo Mills | hu...@ni... > Chief Technologist | > Nightglass Medical Rostering Ltd | +44 207 040 4054 Oleg. -- Oleg Broytman http://phdru.name/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |