Thanks Mike, I was hoping for a under-the-hood solution rather than a recipe since it's a must for using Oracle. Nevertheless, if I get around it, I will provide the recipe (better to have something...)
In the meanwhile, I opted to stay with VARCHAR ... Thanks again, Ofir -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Mike Bayer Sent: Sunday, November 8, 2015 20:25 To: [email protected] Subject: Re: alter VARCHAR column to TEXT under Oracle On 11/08/2015 05:42 AM, Ofir Herzas wrote: > Changing a VARCHAR column to CLOB (TEXT) raises the following exception > under Oracle: > > | > sqlalchemy.exc.DatabaseError:(cx_Oracle.DatabaseError)ORA-22858:invalid > alteration of datatype > [SQL:'ALTER TABLE tab MODIFY col CLOB'] > > | > > While this is an Oracle fault, it would be nice if the abstraction layer > took care of it. > > The proposed solution that I found was to add a new clob column, copy > the data, remove the old column and rename Alembic offers a rough version of this feature in the form of "batch migrations", but that involves a whole table copy. Recipes like adding new columns and copying data can be achieved using custom directives, see http://alembic.readthedocs.org/en/latest/cookbook.html#replaceable-objects for an example of how to make new directives. I will gladly accept documentation illustrating a recipe for this behavior. > > -- > You received this message because you are subscribed to the Google > Groups "sqlalchemy-alembic" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected] > <mailto:[email protected]>. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to a topic in the Google Groups "sqlalchemy-alembic" group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/sqlalchemy-alembic/rDqCsRIDfh4/unsubscribe. To unsubscribe from this group and all its topics, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sqlalchemy-alembic" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
