Re: Do i want to use bases or branches or something else?

2020-02-05 Thread Michael Merickel
-cba8c74dacf6%40googlegroups.com > <https://groups.google.com/d/msgid/sqlalchemy-alembic/9258400f-d23b-4c92-856e-cba8c74dacf6%40googlegroups.com?utm_medium=email_source=footer> > . > -- Michael -- You received this message because you are subscribed to the Google Groups &quo

Re: merging old versions

2019-06-20 Thread Michael Merickel
as the down_revision of later migrations and clear out the old unused migrations that you're replacing. - Michael On Thu, Jun 20, 2019 at 2:37 AM Chris Withers wrote: > Hi All, > > I have some versions that make use of the third party package I no > longer use, how do I collapse

Re: selective migration options (e.g. create and add only)

2017-06-09 Thread Michael Bayer
On Friday, June 9, 2017 at 9:00:00 AM UTC-4, ktang wrote: > > Hi, > > I have an application migrating existing mysql dbs which may have tables > only in some system. > I am trying to use alembic to handle the migration. > > When I migrate the db to a newer version, if I don't want to drop any

Re: Migration fails when changing to single table inheritance

2017-06-07 Thread Michael
: > > > > On 06/07/2017 07:01 PM, Michael wrote: > > Thanks for the insight Mike. I guess the best way to go about that would > > be to just call the raw insert sql statemen in the migration? like in > > > https://stackoverflow.com/questions/23206562/sqlalchemy

Re: Migration fails when changing to single table inheritance

2017-06-07 Thread Michael
6/07/2017 04:44 PM, Michael wrote: > > Hi all, I have a class called MediaChapter(Base), which I've refactored > > into MediaBase(Base) and MediaChapter(MediaBase) When I run the > > migration, I see: > > > > | > > psycopg2.IntegrityError:insert orupdate

Migration fails when changing to single table inheritance

2017-06-07 Thread Michael
Hi all, I have a class called MediaChapter(Base), which I've refactored into MediaBase(Base) and MediaChapter(MediaBase) When I run the migration, I see: psycopg2.IntegrityError: insert or update on table "mediachapter" violates foreign key constraint "fk_mediachapter_id_mediabase" DETAIL:

Re: Generate code to generate db

2017-06-01 Thread Michael
Thanks Mike, I will tinker around with your example. -- 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 sqlalchemy-alembic+unsubscr...@googlegroups.com. For

SQLAlchemy 1.0.0b4 released

2015-03-29 Thread Michael Bayer
SQLAlchemy release 1.0.0b4 is now available. This release contains a handful of fixes and enhancements mostly to address issues that were reported by beta testers. Things are looking very good and it's hoped that *maybe* this will be the last beta, unless a host of new regressions are reported.

Alembic 0.7.5 released

2015-03-19 Thread Michael Bayer
Hey all - Alembic 0.7.5 is now available. This release has a handful of bug fixes and some new features. Changelog is available at: http://alembic.readthedocs.org/en/latest/changelog.html#change-0.7.5 Download Alembic 0.7.5 at: https://pypi.python.org/pypi/alembic/0.7.5.post1 Note

Re: Creating a gist index on a new colmn

2015-03-15 Thread Michael Bayer
the “GIST” identifier for USING is available using the “postgresql_using” keyword argument: http://docs.sqlalchemy.org/en/rel_0_9/dialects/postgresql.html#index-types Jay Payne lett...@gmail.com wrote: I've been looking through the docs and I cannot find out how to create a gist index on

Re: stack trace with key error from: alembic revision --autogenerate -m first rev

2014-12-23 Thread Michael Bayer
Dewey Gaedcke de...@pathoz.com wrote: Is it likely that this construct: @event.listens_for(Column, before_parent_attach) def attach(target, cls): # cls is the table obj, not the declarative class target.name = %s%s % (cls.name[0:4], target.name) is interfering with Alembic??

Re: stack trace with key error from: alembic revision --autogenerate -m first rev

2014-12-23 Thread Michael Bayer
Michael Bayer mike...@zzzcomputing.com wrote: Dewey Gaedcke de...@pathoz.com wrote: this is the table that’s being reflected from your database, first of all, so you definitely don’t want to be changing .name in that case, because it is set to exactly what the name is in the DB

Re: Using a 3rd Party Dialect

2014-11-01 Thread Michael Bayer
alembic doesn’t have a formally published extension API as of yet, to get that to work you’d need to make an Impl: from alembic.ddl.postgresql import PostgresqlImpl class RedshiftImpl(PostgresqlImpl): __dialect__ = ‘redshift’ that will register the name “redshift” into alembic’s lookup.

Re: MySQL 1071 Error when using alembic autogenerate from SQLAlchemy models

2014-10-08 Thread Michael Bayer
the first hit on google for this is a stack overflow answer that points to the relevant details for this message: http://stackoverflow.com/questions/1814532/1071-specified-key-was-too-long-max-key-length-is-767-bytes the size of the index is being impacted by the character encoding in use; see

Alembic 0.6.6 released

2014-08-07 Thread Michael Bayer
Alembic 0.6.6 Released This is a bug fix release. For a list of changes please see: http://alembic.readthedocs.org/en/latest/changelog.html#change-0.6.6 As always, download Alembic on pypi at: https://pypi.python.org/pypi/alembic/ -- You received this message because you are subscribed to

Re: TypeError on updating DB with new date

2014-08-03 Thread Michael
= pub_time.replace(tzinfo=None)* And things seem to take just fine now. On Saturday, August 2, 2014 10:33:43 PM UTC-4, Michael Bayer wrote: On Aug 2, 2014, at 5:00 PM, Michael taoma...@gmail.com javascript: wrote: *TypeError: can't compare offset-naive and offset-aware datetimes* I'm comparing

Re: how to handle exceptions in alembic migrations?

2014-06-08 Thread Michael Bayer
On Jun 8, 2014, at 9:12 AM, Ofir Herzas herz...@gmail.com wrote: 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: A change was already made and not needed (e.g. if I try to

Re: fix pull request for fk constraint rendering with metadata schema

2014-06-04 Thread Michael Bayer
the fix looks fine and we use git on both bitbucket and github. Will try to test it out soon, thanks! On Jun 4, 2014, at 6:05 AM, Andreas Zeidler a...@zitc.de wrote: hi, i ran into an error while using a metadata schema and tried to come up with a fix:

Re: DBSession.add() has no effect in tweepy callback in pyramid 1.5

2014-06-01 Thread Michael Merickel
: ... On Sun, Jun 1, 2014 at 10:27 PM, Michael taomaili...@gmail.com wrote: Hi all, I'm trying to store tweets into an sqlite db and when I call DBSession.add() to store it, it seems to do nothing. Here is a trace of me setting up the db: http://pastebin.com/tB4KLLXj Here is how I set

Re: Using alembic in a plugin pattern

2014-05-11 Thread Michael Bayer
On May 11, 2014, at 9:03 AM, Steeve C steevechaill...@gmail.com wrote: hi, I'm looking for writing plugins (stevedore) for my application, all plugins are new python modules and can create some entry|columns|table in the application database, I want to manage migration by plugins|modules

Alembic 0.6.4 released

2014-03-28 Thread Michael Bayer
Hi list - Alembic 0.6.4 is released. This release has a bunch of fixes that have been piling up; in particular, a whole bunch of fixes to work with the new naming_convention feature in SQLAlchemy 0.9, and ever more fixes regarding autogenerate with indexes and unique constraints. As

Re: Delete class in model and downgrade, bulk_insert

2014-03-16 Thread Michael Bayer
On Mar 15, 2014, at 10:29 PM, Tom Haulitschke thomas.haulitsc...@googlemail.com wrote: I really have problems with the downgrade() part: def downgrade(): ### commands auto generated by Alembic - please adjust! ### dog_table = op.create_table('dog',

Re: pyc files left in version folder create ghost history

2014-03-14 Thread Michael Bayer
well, for most releases we only read the .py files, until someone reported it as a bug that we *don't* read the .pyc files. because that person is doing sourceless installs. this is issue 163: https://bitbucket.org/zzzeek/alembic/issue/163 so in 623c7e76ef04c5656 you now need to add the flag

Re: Enum name gets lost.

2014-02-04 Thread Michael Mulqueen
Sorry, I should have noted the versions earlier. SQLAlchemy: 0.7.4 Alembic: 0.6.3 Python: 2.7.3 Mike On Tuesday, February 4, 2014 1:56:57 PM UTC, Michael Mulqueen wrote: I'm hoping someone can help with this. My code is all built on SA's declarative base. What's happening is that from my

Alembic 0.6.3 released

2014-02-02 Thread Michael Bayer
Hey lists - Alembic 0.6.3 is now available. 0.6.3 has a handful of bug fixes, the vast majority geared towards the autogenerate feature, including getting schemas to work with index and unique constraint detection as well as improved handling of schema attributes on Table objects within