Re: can't modify a column name

2016-07-11 Thread Ofir Herzas
wrote: > > > On 07/11/2016 12:08 PM, Ofir Herzas wrote: > >> It seems that I am wrong since I do see all column names in uppercase >> using sql developer (all but reserved words) so I don't know how this >> happened since my models are all lowercase (could it

Re: can't modify a column name

2016-07-11 Thread Ofir Herzas
ter method does solve the issue (I just hope it wouldn't introduce problems with mysql...) Thanks. On Monday, July 11, 2016 at 6:40:09 PM UTC+3, Ofir Herzas wrote: > > For sure the table was not created using capital letters or quotes but > I'll try your suggestion, thanks. >

Re: can't modify a column name

2016-07-11 Thread Ofir Herzas
For sure the table was not created using capital letters or quotes but I'll try your suggestion, thanks. On Jul 11, 2016 6:02 PM, "Mike Bayer" wrote: > > > On 07/11/2016 10:48 AM, Ofir Herzas wrote: > >> Alembic 0.8.6 >> cx-Oracle 5.1.3 >> SQLAlchemy

can't modify a column name

2016-07-11 Thread Ofir Herzas
Alembic 0.8.6 cx-Oracle 5.1.3 SQLAlchemy 1.0.14 I have a column named "scope" (without the double quotes) with an existing type of SmallInt and I'm trying to change it to an Integer with the following line: op.alter_column('t_rule', 'scope', existing_type=sa.SmallInteger(), type_=sa .Integer())

Re: Alter boolean column on Oracle

2015-12-11 Thread Ofir Herzas
AM, "Mike Bayer" wrote: > > > On 12/11/2015 04:39 PM, Ofir Herzas wrote: > > Hi Mike, > > I've just checked my code and I noticed that I already use existing_type > > (not sure what was wrong with the documentation in that aspect). > > > > Can

Re: Alter boolean column on Oracle

2015-12-11 Thread Ofir Herzas
that doesn't stop alter_column from trying to remove the check constraint by itself, leading to the same exception. On the other hand, I didn't see any parameter in the alter_column method that accepts a constraint name Thanks, Ofir On Thursday, December 10, 2015 at 3:39:42 PM UTC+2, Of

RE: Alter boolean column on Oracle

2015-12-10 Thread Ofir Herzas
@googlegroups.com] On Behalf Of Mike Bayer Sent: Thursday, December 10, 2015 19:24 To: sqlalchemy-alembic@googlegroups.com Subject: Re: Alter boolean column on Oracle On 12/10/2015 08:39 AM, Ofir Herzas wrote: > I'm trying to run an alter_column operation from a Boolean type column > to Smal

RE: Alter boolean column on Oracle

2015-12-10 Thread Ofir Herzas
y -Original Message- From: sqlalchemy-alembic@googlegroups.com [mailto:sqlalchemy-alembic@googlegroups.com] On Behalf Of Mike Bayer Sent: Thursday, December 10, 2015 19:24 To: sqlalchemy-alembic@googlegroups.com Subject: Re: Alter boolean column on Oracle On 12/10/2015 08:39 AM, Ofir Herzas w

Alter boolean column on Oracle

2015-12-10 Thread Ofir Herzas
I'm trying to run an alter_column operation from a Boolean type column to SmallInteger on Oracle. According to the documentation: "...Type changes which are against the SQLAlchemy “schema” types Boolean and Enum <

RE: alter VARCHAR column to TEXT under Oracle

2015-11-08 Thread Ofir Herzas
ginal Message- From: sqlalchemy-alembic@googlegroups.com [mailto:sqlalchemy-alembic@googlegroups.com] On Behalf Of Mike Bayer Sent: Sunday, November 8, 2015 20:25 To: sqlalchemy-alembic@googlegroups.com Subject: Re: alter VARCHAR column to TEXT under Oracle On 11/08/2015 05:42 AM, Ofir Herzas

alter VARCHAR column to TEXT under Oracle

2015-11-08 Thread Ofir Herzas
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 l

Re: alter table with sequence

2015-09-21 Thread Ofir Herzas
Thanks Mike. I already did use execute. I was hoping for a more generic solution, but it'll do for now... On Sep 21, 2015 6:11 PM, "Mike Bayer" wrote: > > > On 9/21/15 10:18 AM, Ofir Herzas wrote: > > rename_table operation does not rename sequences if they exist

alter table with sequence

2015-09-21 Thread Ofir Herzas
rename_table operation does not rename sequences if they exist. This causes a problem that the renamed table is unusable since the sequence is missing. In Oracle, a simple rename works well (RENAME old_seq_name TO new_seq_name;) although it says "table renamed". Is there a sequence rename opera

Re: best practice for creating new tables

2015-09-01 Thread Ofir Herzas
2015 at 5:13:13 PM UTC+3, Jon Rosebaugh wrote: > > I'm afraid I don't understand the issue. It sounds like you have > concerns that your SQLAlchemy models do not always correspond to the > state of the DB? > > On Tue, Sep 1, 2015, at 03:07 AM, Ofir Herzas wrote: &g

best practice for creating new tables

2015-09-01 Thread Ofir Herzas
I've been working with sqlalchemy/alembic for several years now, but just recently stumbled on an important issue. Here is how I use to work: 1. Issue Base.metadata.create_all(engine) to make sure that missing tables are created 2. check the current revision by issuing context.get_current_revi

Re: how to handle exceptions in alembic migrations?

2014-06-09 Thread Ofir Herzas
racle so I guess I'll just have to live with it ... Thanks again, Ofir On Tuesday, June 10, 2014 1:45:07 AM UTC+3, Michael Bayer wrote: > > > On Jun 9, 2014, at 3:10 AM, Ofir Herzas > > wrote: > > > > On Sunday, June 8, 2014 10:09:12 PM UTC+3, Michael Bayer wrote:

Re: how to handle exceptions in alembic migrations?

2014-06-09 Thread Ofir Herzas
On Sunday, June 8, 2014 10:09:12 PM UTC+3, Michael Bayer wrote: > > > On Jun 8, 2014, at 11:08 AM, Ofir Herzas > > wrote: > > > Hi Michael, > > Thanks for your prompt response and for the great tools you develop. > > > > I have 2 reasons for doing t

Re: how to handle exceptions in alembic migrations?

2014-06-08 Thread Ofir Herzas
handle it? Regarding the table lock, this is exactly what I'm trying to prevent (script hang). Isn't there any test I could make before my script hangs? Thanks, Ofir On Sunday, June 8, 2014 5:22:46 PM UTC+3, Michael Bayer wrote: > > > On Jun 8, 2014, at 9:12 AM, Ofir Herzas >

how to handle exceptions in alembic migrations?

2014-06-08 Thread Ofir Herzas
I have an alembic migration script and I want to add some exception handling but not sure what is the best practice. Basically, I have several issues to handle: 1. A change was already made and not needed (e.g. if I try to add_column, and this column already exists, I want it to continu