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 >

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.

Re: Support for postgres URL from an environment variable for alembic

2015-03-25 Thread Michael Bayer
Selena Deckelmann wrote: > Hi! > > We are working on a cloud deployment of our application, and would love to > use a URL from the environment to configure alembic's connection to Postgres. > > Are there any existing plans to make this happen? If we make a patch, would > that be something

SQLAlchemy 1.0.0b3 released

2015-03-20 Thread Michael Bayer
SQLAlchemy release 1.0.0b3 is now available. This is an emergency re-release of 1.0.0b2 to repair an erroneous commit, regarding the MySQL “utf8mb4” fix which was inadvertently commented out. Download 1.0.0b3 at: http://www.sqlalchemy.org/download.html -- You received this message because y

SQLAlchemy 1.0.0b2 released

2015-03-20 Thread Michael Bayer
SQLAlchemy release 1.0.0b2 is now available. This is the second pre-release in the 1.0.0 series which includes a small handful of regression fixes and some additional features. We'd like to thank those who have been beta testing the 1.0.0 series and encourage all beta testers to upgrade to beta2!

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 th

Re: Is Firebird supported?

2015-03-17 Thread Michael Bayer
on Alembic, there’s no dialect as of yet.Though you can make a “fake” one like this: from alembic.ddl import impl class FirebirdDialect(impl.DefaultImpl): __dialect__ = ‘firebird' transactional_ddl = True just making that class will add it to the _impls dict and will get you past t

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 wrote: > I've been looking through the docs and I cannot find out how to create a gist > index on a geometry colum

SQLAlchemy 1.0.0b1 released

2015-03-13 Thread Michael Bayer
Hey list - I’m very pleased to announce SQLAlchemy’s first foray into the world of “1.0”, which is our 1.0.0b1 release. As 1.0.0b1 includes “b1”, this is a “beta” release, intended for widespread evaluation. Assuming you’re all using a modern version of pip, it should not install automatically un

SQLAlchemy 0.9.9 Released

2015-03-10 Thread Michael Bayer
SQLAlchemy release 0.9.9 is now available. Release 0.9.9 is a large maintenance release featuring 30 changes, mostly bug fixes. A handful of modest feature adds are also present, including new Core features for SQLite, Postgresql, and new API features to provide better control of transaction isola

Re: Generating migrations as SQL scripts should not infer connection status

2015-02-27 Thread Michael Bayer
On Feb 27, 2015, at 4:26 PM, Alexander Martin wrote: >> A major capability of Alembic is to generate migrations as SQL scripts, >> instead of running them against the database - this is also referred to as >> offline mode. > - http://alembic.readthedocs.org/en/latest/offline.html > > I apol

Re: Managing migrations on seperate dbs + models

2015-02-13 Thread Michael Bayer
Dimitris Theodorou wrote: > Hi, > > I have a use case where I have two databases, each of which provides a subset > of my models. I have two seperate __abstract__ base classes (each with its > own metadata) that each model inherits from to determine on which database > they belong. To manag

Re: Checking code and database are in sync

2015-02-11 Thread Michael Bayer
e = . > > The same is true for unique constraints. > > Any ideas? > > Thanks > Tim > > On Tuesday, 10 February 2015 14:05:27 UTC+13, Michael Bayer wrote: > > > tim.mi...@leapfrog3d.com wrote: > > > Hi all, > > > > I would like to hav

Re: Progress reporting during a lengthy alembic migration

2015-02-10 Thread Michael Bayer
vitaly numenta wrote: > During a recent particularly lengthy *single-version* migration that took > about 17 hours, my IT colleague asked to enable some periodic progress > reporting from alembic to be able to tell roughly how far along the migration > is. Even if it was just to enable echoi

Re: Bundle multiple column changes in single mysql ALTER TABLE

2015-02-10 Thread Michael Bayer
vitaly numenta wrote: > On Tuesday, February 10, 2015 at 7:38:10 AM UTC-8, Michael Bayer wrote: > > > thank you for your quick follow-up and explanation. I was trying to get > something different from alembic; mysql supports this syntax: > > ALTER TABLE tbl_nam

Re: NotImplementedError when calling batch_op.create_primary_key within batch_alter_table context

2015-02-10 Thread Michael Bayer
it’s not implemented yet. you’d need to use create_primary_key outside of the batch context for now. vitaly numenta wrote: > Using alembic 0.7.4 with mysql on Mac OS X > > I get a NotImplementedError exception when calling > batch_op.create_primary_key within batch_alter_table context >

Re: Autogenerate generates duplicates

2015-02-09 Thread Michael Bayer
Diogo Baeder wrote: > Hi, > > In a project I'm working on, I'm using "alembic revision --autogenerate" so > that it generates my migration scripts based on the models I have; however, > even if I've already generated a migration script which already has the > operation for a certain model (

Re: Checking code and database are in sync

2015-02-09 Thread Michael Bayer
tim.mitch...@leapfrog3d.com wrote: > Hi all, > > I would like to have a post-deployment check that verifies the sqlalchemy > metadata in the code matches what is in the database. > I was thinking that doing something like > > alembic revision --autogenerate --sql > changes.sql > > and then c

Re: Running migrations programmatically for automated tests

2015-02-09 Thread Michael Bayer
the latest recipe that shows this is: http://alembic.readthedocs.org/en/latest/cookbook.html#sharing-a-connection-with-a-series-of-migration-commands-and-environments that includes sharing the connection and running command.upgrade. cursors getting stuck usually happens when tables are being dro

Re: Best location and name for Alembic scripts directory

2015-01-26 Thread Michael Bayer
Matt McClure wrote: > After reading the tutorial, and searching a little in the documentation and > group archives, I'm unclear on the best location and name of the Alembic > scripts directory. > > The tutorial advises: > > yourproject/ > alembic/ > > And indicates: > > yourproject -

Alembic 0.7.4 Released

2015-01-12 Thread Michael Bayer
Hey list - Alembic 0.7.4 is released. This release fixes a short series of issues with the autogenerate feature. The changelog is available at: http://alembic.readthedocs.org/en/latest/changelog.html#change-0.7.4 -- You received this message because you are subscribed to the Google Groups "

Re: Run alembic upgrade header inside a python function

2015-01-05 Thread Michael Bayer
Dorian Hoxha wrote: > Hi list(), > > I'm currently using 1 db / customer. That means in development I test the > migration with 1 db and on production I want to run the 'upgrade' command on > each database. > > So I just want something like: > > def upgrade(connection details or metadata,

Re: Error when running migration from scratch (empty db)

2014-12-30 Thread Michael Bayer
that’s fixed in https://bitbucket.org/zzzeek/alembic/issue/258/upgrade-blank-db-when-theres-no-version and I’ve released 0.7.3. Michael Bayer wrote: > oh.You have *no* versions, that does it. Right! OK that’s a bug on my > end. will fix. > > > > Michael

Re: Error when running migration from scratch (empty db)

2014-12-30 Thread Michael Bayer
oh.You have *no* versions, that does it. Right! OK that’s a bug on my end. will fix. Michael Bayer wrote: > looks a bit like an alembic issue. > > do you have a lot of migration files, and if the number is few, what does an > “alembic history” look like here? som

Re: Error when running migration from scratch (empty db)

2014-12-30 Thread Michael Bayer
looks a bit like an alembic issue. do you have a lot of migration files, and if the number is few, what does an “alembic history” look like here? something about your revision tree is weird. Or in conjunction with what’s being passed, can you tell what “revision” is at the start of the stack

Re: How to generate alembic_version table with current head version

2014-12-27 Thread Michael Bayer
target_metadata=target_metadata > ) > > try: > with context.begin_transaction(): > context.run_migrations() > finally: > # don't close connection if it is from outside > if not hasattr(config, 'connect

Re: How to generate alembic_version table with current head version

2014-12-26 Thread Michael Bayer
n Wed, Dec 24, 2014 at 8:35 AM, Michael Bayer <mailto:mike...@zzzcomputing.com>> wrote: > Pan Luo mailto:luopa...@gmail.com>> wrote: > >> If someone new come to the project and they use db.create_all() or some >> script to create a fresh new database with declared

Re: How to generate alembic_version table with current head version

2014-12-24 Thread Michael Bayer
Pan Luo wrote: > If someone new come to the project and they use db.create_all() or some > script to create a fresh new database with declared models. There is no > alembic_version table and he/she will run into problems when doing the > upgrade. Is there something in alembic to support it?

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

2014-12-23 Thread Michael Bayer
27;t really understand the suggestion….. from model.tables import Base @event.listens_for(Column, "before_parent_attach") def attach(column, table): if table.metadata is Base.metadata: column.name = "%s%s” % (table.name[0:4], column.name) > Thanks, Dewey > > On Tuesday, De

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

2014-12-23 Thread Michael Bayer
Michael Bayer wrote: > Dewey Gaedcke 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. > > the orde

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

2014-12-23 Thread Michael Bayer
Dewey Gaedcke 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?? yes.

Alembic 0.7.2 Released

2014-12-18 Thread Michael Bayer
Hey lists - Alembic 0.7.2 is released. This is a small bugfix release to catch some issues in the batch support, foreign key support, and new versioning system that are local to the SQLite, MySQL, and Oracle/MSSQL backends, respectively. Changelog is at http://alembic.readthedocs.org/en/late

Re: Dry Run for alembic revision

2014-12-02 Thread Michael Bayer
> On Dec 2, 2014, at 4:06 PM, Daniel Son wrote: > > Hi, > > Is there a way to have a dry run for alembic revision? > Or a very easy way to detect an error case via the command. For example, I > have 2 revisions that have just branched and now I need to create a merge > point as the next revi

Re: Updating multiple Postgres schema objects from single SQL Alchemy model

2014-11-18 Thread Michael Bayer
> On Nov 17, 2014, at 10:07 PM, Nick Retallack wrote: > > On Monday, November 17, 2014 6:55:49 PM UTC-8, Michael Bayer wrote: > for what specifically? Autogenerate will work with whatever data you give > it. Send in a target_metadata with what you want to view on the Pyt

Re: Updating multiple Postgres schema objects from single SQL Alchemy model

2014-11-17 Thread Michael Bayer
for what specifically? Autogenerate will work with whatever data you give it. Send in a target_metadata with what you want to view on the Python side and tailor an include_object() function if you need in order to filter what comes from the database. > On Nov 17, 2014, at 7:46 PM, Nick Re

Re: Error when autogenerate migration scripts with alembic

2014-11-17 Thread Michael Bayer
> On Nov 17, 2014, at 10:20 AM, Ons wrote: > > Hi, > > I want to use alembic to auto-generate migrations scripts for my postgres db. > When i tried: > #alembic upgrade and alembic downgrade both worked properly, but when i > modified my models and tried > #alembic revision --autogenerate i

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: KeyError when Building an Up to Date Database from Scratch

2014-10-21 Thread Michael Bayer
This looks like some kind of import issue or something you’re doing is interfering with the alembic.context module. Another issue is that your stack trace seems to begin with running the “alembic” command; the example in the documentation refers to API use of Alembic, not using the command lin

SQLAlchemy 0.9.8

2014-10-13 Thread Michael Bayer
Hey lists - SQLAlchemy release 0.9.8 is now available. As the 1.0 series is well underway, 0.9.8 continues to close out bugs that can still be applied without significant risk of destabilization. In contrast to 0.9.7 where we were still hitting upon regressions, 0.9.8 fixes a set of garden vari

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

Re: Create materialized view with reflected metadata

2014-10-02 Thread Michael Bayer
On Oct 2, 2014, at 11:41 AM, Stefan Urbanek wrote: > Thanks, but that is for SQLAlchemy and we are already using constructions > like that. That is not a problem at all. Problem is in Alembic migration - > how to correctly get a reflected Table object from the database just being > migrated?

Re: Create materialized view with reflected metadata

2014-09-30 Thread Michael Bayer
object to be > created by the migration. > > Stefan > > On Friday, September 26, 2014 5:34:52 PM UTC-4, Michael Bayer wrote: > not sure if i understand the question.where's the reflected table here? > are you trying to reflect the underlying SELECT from it, o

Re: Create materialized view with reflected metadata

2014-09-26 Thread Michael Bayer
not sure if i understand the question.where's the reflected table here? are you trying to reflect the underlying SELECT from it, or make a new SELECT out of an existing view ? if the question is, "I want to reflect a materialized view in Postgresql", we just added that in 1.0, so is not r

Alembic 0.6.7 Released

2014-09-09 Thread Michael Bayer
Alembic 0.6.7 is now available. This is a very small release with two fixes that were ready to go out, and after which I'm going to start on the 0.7.0 series. The two changes are support for SQL Server "sp_rename()" for tables, and some workarounds to allow Postgresql functional indexes to be

Re: IndexError when attempting to drop a constraint on MySQL

2014-08-19 Thread Michael Bayer
On Aug 19, 2014, at 10:39 AM, Stephan Hügel wrote: > > > Argh there was a global install of 0.9.4 hanging around. Sorry sorry sorry. OK but did this fix resolve? f() is in 0.9.4 of SQLAlchemy though there were some refinements following that. -- You received this message because you

Re: IndexError when attempting to drop a constraint on MySQL

2014-08-18 Thread Michael Bayer
On Aug 18, 2014, at 11:43 AM, Stephan Hügel wrote: > On Monday, 18 August 2014 16:07:30 UTC+1, Michael Bayer wrote: > > On Aug 18, 2014, at 11:02 AM, Michael Bayer wrote: > >> >> On Aug 18, 2014, at 11:00 AM, Michael Bayer wrote: >> >>> >>

Re: IndexError when attempting to drop a constraint on MySQL

2014-08-18 Thread Michael Bayer
On Aug 18, 2014, at 11:02 AM, Michael Bayer wrote: > > On Aug 18, 2014, at 11:00 AM, Michael Bayer wrote: > >> >> On Aug 18, 2014, at 10:21 AM, Stephan Hügel wrote: >> >>> >>> Yep, I'm using naming_convention, and can confirm tha

Re: IndexError when attempting to drop a constraint on MySQL

2014-08-18 Thread Michael Bayer
On Aug 18, 2014, at 11:00 AM, Michael Bayer wrote: > > On Aug 18, 2014, at 10:21 AM, Stephan Hügel wrote: > >> >> Yep, I'm using naming_convention, and can confirm that the drop operation >> isn't being wrapped by f(). >> >> (And

Re: IndexError when attempting to drop a constraint on MySQL

2014-08-18 Thread Michael Bayer
On Aug 18, 2014, at 10:21 AM, Stephan Hügel wrote: > > Yep, I'm using naming_convention, and can confirm that the drop operation > isn't being wrapped by f(). > > (And also autogenerate, for the avoidance of ambiguity) the rendering of drop_constraint does not include the "type" parameter

Re: IndexError when attempting to drop a constraint on MySQL

2014-08-18 Thread Michael Bayer
the error indicates you're making use of the "naming_convention" feature of MetaData, and that the naming convention applied to unique constraints requires that it derive the name from some of the constrained columns. Is this the case? If you want to force the name to be unmodified when using t

Re: ImportError in foreman run alembic branches

2014-08-12 Thread Michael Bayer
t's more conventional way of setting this up? > > And it works now, if I run the script from my root directory, that contains > my_app and alembic directories. I was confused, because other commands would > run without issues. > > Thanks a lot! > > On Monday, Augus

Re: ImportError in foreman run alembic branches

2014-08-11 Thread Michael Bayer
I would guess this is a side effect of something that occurs in your env.py script. Not all commands load env.py, so if your migration files depend on env.py being loaded in order for their imports to work that would be what’s happening here. On Aug 11, 2014, at 8:21 PM, Anton wrote: >

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-02 Thread Michael Bayer
On Aug 2, 2014, at 5:00 PM, Michael wrote: > TypeError: can't compare offset-naive and offset-aware datetimes > > > I'm comparing the date of the rss feed items published date with the > latestpost of the rss feed. I ensure that the dates generated have pytz.UTC() > added. Note the actual is

SQLAlchemy 0.8.7 Released

2014-07-22 Thread Michael Bayer
Hey list - SQLAlchemy release 0.8.7 is now available. Release 0.8.7 contains a selected set of bug fix backports from release 0.9, including a selected set of ORM and extension fixes as well as dialect fixes for MySQL, Postgresql, and SQL Server. Users should carefully review the Changelog (h

SQLAlchemy 0.9.7 Released

2014-07-22 Thread Michael Bayer
Hey list - SQLAlchemy release 0.9.7 is now available. The 0.9 series is now entering maintenance mode where major new features are now targeted at the 1.0 series. Release 0.9.7 contains a wide range of bugfixes, many of which are identified as regressions from previous 0.9.X releases including

Re: how to handle exceptions in alembic migrations?

2014-06-10 Thread Michael Bayer
ng MySQL and Oracle 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

Re: how to handle exceptions in alembic migrations?

2014-06-09 Thread Michael Bayer
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: > > > 2. Sometimes in the development phase, I run the migration but then add > > some other changes and wish to apply them also > > > >

Re: how to handle exceptions in alembic migrations?

2014-06-08 Thread Michael Bayer
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 that: > 1. When I install my application on a new environment (blank db - no > alembic_version), Alembic tries to run all migratio

Re: how to handle exceptions in alembic migrations?

2014-06-08 Thread Michael Bayer
On Jun 8, 2014, at 9:12 AM, Ofir Herzas 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 add_column, an

Re: Alembic crashes on wide-tables

2014-06-05 Thread Michael Bayer
On Jun 4, 2014, at 9:37 PM, Ryan Kelly wrote: > > > On Wednesday, June 4, 2014 5:11:19 PM UTC-4, Michael Bayer wrote: > > On Jun 4, 2014, at 4:29 PM, Ryan Kelly wrote: > > > Alembic cannot generate a revision for a table with 255 columns, as the > > resu

Re: Alembic crashes on wide-tables

2014-06-04 Thread Michael Bayer
On Jun 4, 2014, at 4:29 PM, Ryan Kelly wrote: > Alembic cannot generate a revision for a table with 255 columns, as the > resulting python code is not valid. Python cannot handle a function call with > more than 255 arguments. At work, we get around this by defining the columns > as a list an

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 wrote: > hi, > > i ran into an error while using a metadata schema and tried to come up with a > fix: https://github.com/zzzeek/alembic/pull/1

Re: How to determine whether Alembic is active

2014-06-04 Thread Michael Bayer
t;bind" on Session is just the engine again, so it's a little odd you can pass that right into context.configure() and nothing breaks.I'm not really sure it depends on what Session.bind is here. > > On Wednesday, June 4, 2014 12:55:57 PM UTC+10, Michael Bayer wrote: >

Re: How to determine whether Alembic is active

2014-06-03 Thread Michael Bayer
On Jun 3, 2014, at 10:37 PM, gbr wrote: > I went ahead and made the modification as suggested. Alembic and my > application are now using the application's database connection and sessions. > > However, the system locks up during a migration when I query for some > application data which I ne

Re: patterns for using alembic in tests

2014-06-03 Thread Michael Bayer
I haven't looked at plugins specific to Alembic. People typically refer to the .upgrade() and .stamp() commands at an API level to have migrations run as part of the test suite. On Jun 3, 2014, at 8:11 PM, Ali-Akber Saifee wrote: > Hi, > > I'm hoping to use alembic to manage database migra

Re: Index DDL not emitted

2014-06-02 Thread Michael Bayer
given: from sqlalchemy import * from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class Dummy(Base): __tablename__ = "dummy" id = Column(Integer, primary_key=True) f1 = Column(Integer, index=True) e = create_engine("mysql://scott:tiger@localhost/test"

Re: How to determine whether Alembic is active

2014-05-13 Thread Michael Bayer
if possible, I'd modify env.py to make use of your application's normal engine/session mechanics. There would be no "alembic_get_session()" method. Whatever mechanism your app uses to get at the Engine/Session, pull it in within env.py and use the exact same environment for migrations.

Re: How to configure multiple databases

2014-05-12 Thread Michael Bayer
there's no standard per se. I'm partial to .ini files and in particular a test.ini file for tests. Environment variables are another option. The app overall needs a way to differentiate database urls for tests vs. running normally, so migrations aren't special. The migration environment

Re: Using alembic in a plugin pattern

2014-05-11 Thread Michael Bayer
On May 11, 2014, at 9:03 AM, Steeve C 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 > > is it possible

Re: Using alembic with the Declarative Enum recipe.

2014-05-06 Thread Michael Bayer
How relevant are the issues discussed in > this thread to SQLAlchemy 9.3? I was intending to use your declarative enum > recipe posted from '11. > > -Darin > > > On Wednesday, June 5, 2013 10:35:07 AM UTC-4, Michael Bayer wrote: > > On Jun 5, 2013, at 6:13 AM, Jan W

Alembic 0.6.5 Released

2014-05-03 Thread Michael Bayer
Hey list(s) - Alembic 0.6.5 is now released. This release contains four bug fixes and one new feature which allows transactional DDL to be run in a transaction per migration file, rather than for the series of migrations as a whole. Full changelog is at: from http://alembic.readthedocs.org/en

Re: how to import local module to upgrade module?

2014-04-21 Thread Michael Bayer
put dependency models into your main application, not the alembic directory. the "env.py" file is loaded through a special per-file loader, so it isn't really part of a Python "package" per se. the other things that env.py needs, have them import from your normal application, e.g. "from myapp.

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 alw

SQLAlchemy 0.9.4 released

2014-03-28 Thread Michael Bayer
Hi list - SQLAlchemy release 0.9.4 is now available. 0.9.4 contains mostly bug fixes, split across regressions local to 0.9 as well as more general issues. There are also some new features, in particular a major change to the testing system to support py.test in addition to nose. Many bugfixes

SQLAlchemy 0.8.6 released

2014-03-28 Thread Michael Bayer
Hi list - SQLAlchemy release 0.8.6 is now available. Release 0.8.6 contains a variety of bugfixes backported from the 0.9 series. Areas of fix include ORM issues as well as dialect-specific issues. Users should carefully review the Changelog at http://www.sqlalchemy.org/changelog/CHANGES_0_8_6

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 wrote: > > > I really have problems with the downgrade() part: > > def downgrade(): > ### commands auto generated by Alembic - please adjust! ### > dog_table = op.create_table('dog', > sa.Column('id', sa.INTEGER(), pri

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

SQLAlchemy 0.9.3 Released

2014-02-19 Thread Michael Bayer
Hey list - SQLAlchemy release 0.9.3 is now available. Release 0.9.3 includes a wide array of bugfixes and a few new features. A critical subset of these fixes are also backported to release 0.8.5. Both 0.9.3 and 0.8.5 are being released simultaneously to resolve a concurrency-related regressio

SQLAlchemy 0.8.5 Released

2014-02-19 Thread Michael Bayer
Hey list - SQLAlchemy release 0.8.5 is now available. Release 0.8.5 is a bugfix release which includes a wide array of fixes backported from the 0.9 series. Both 0.8.5 and 0.9.3 are being released simultaneously to resolve a concurrency-related regression introduced in version 0.8.4, which can

Re: Enum name gets lost.

2014-02-04 Thread Michael Bayer
we’ve had a lot of issues with repr() of Enum and they should be fixed in recent versions of SQLAlchemy, in particular the “name” render appears to work as of the 0.8 series. With 0.7.4 you’re at the very bottom of compatibility w/ alembic, so if you can’t upgrade you can do a workaround via re

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 autoge

SQLAlchemy 0.9.2 Released

2014-02-02 Thread Michael Bayer
heya list - SQLAlchemy release 0.9.2 is now available. Release 0.9.2, while only a "point release" in the new 0.9 series, contains a large list of bug and regression fixes across ORM, Core and dialect, as well as a significant number of new features, particularly in the area of database metadata

Re: Hacky fix I had to put in to get Alembic to work with custom type decorators

2014-02-01 Thread Michael Bayer
On Jan 30, 2014, at 1:28 PM, jason.cl...@360pi.com wrote: > I'm wondering if there is a better way of getting around an issue I ran into > with Alembic, what I did is below. I’ve updated the documentation and also added a new feature user_module_prefix in the upcoming 0.6.3 to address this spe

Re: Alembic with create_all

2014-01-31 Thread Michael Bayer
) > > However, once I have the context set up with a connection, I can't figure out > how to retrieve it in a version script. > > Thanks, > Ryan > > On Monday, January 27, 2014 6:12:52 AM UTC-6, Michael Bayer wrote: > > On Jan 27, 2014, at 1:47 AM, Ryan

Re: Hacky fix I had to put in to get Alembic to work with custom type decorators

2014-01-30 Thread Michael Bayer
On Jan 30, 2014, at 1:28 PM, jason.cl...@360pi.com wrote: > I'm wondering if there is a better way of getting around an issue I ran into > with Alembic, what I did is below. > > I have models which have custom type decorators, when I ran alembic it > complained that SafeGuid wasn't on the mode

Re: BigSerial + Alembic

2014-01-30 Thread Michael Bayer
On Jan 30, 2014, at 11:42 AM, jason.cl...@360pi.com wrote: > I'm on my last hurdle with implementing Alembic with our SqlAlchemy models, > and the issue is I can't get Alembic to implement my id column with > BIGSERIAL, it always defaults to SERIAL. I implemented a TypeDecorator on > each of

Re: Alembic + custom postgresql types

2014-01-29 Thread Michael Bayer
for types where you need to fully specify DDL from the ground up you use UserDefinedType: http://docs.sqlalchemy.org/en/rel_0_9/core/types.html?highlight=userdefinedtype#sqlalchemy.types.UserDefinedType if this type is more in the realm of having to emit PG’s “CREATE TYPE” and all that, that’s

Re: Alembic with create_all

2014-01-27 Thread Michael Bayer
On Jan 27, 2014, at 1:47 AM, Ryan Eberhardt wrote: > Context: I'm using Pyramid with SQLAlchemy, and am pretty deep into a project > with no database versioning. I'm looking to use Alembic to start doing that. > > I read at > http://alembic.readthedocs.org/en/latest/tutorial.html#building-an

Re: While fixing a 'could not locate a bind configured ..' error got a 'could not locate database' error

2014-01-22 Thread Michael Bayer
On Jan 22, 2014, at 12:07 AM, Michael wrote: > In my pyramid app, a celery task was giving me: "Task > lr.queue.tasks.fetch_bmark_content[b667d64c-5505-408c-bd12-f9a1863b2e7c] > raised unexpected: UnboundExecutionError('Could not locate a bind configured > on mapper Mapper|Bmark|bmarks, SQL e

Re: How to write alembic migration script in order to deal with complex ForeignKeyConstraint?

2014-01-21 Thread Michael Bayer
On Jan 21, 2014, at 6:21 AM, claude.huc...@sysgrove.com wrote: > I'm using SQLAlchemy declarative extension, and I have new class inheriting > from Base > with such foreign key contraints : > > __table_args__ = ( > ForeignKeyConstraint( > ['MarketType', 'ItemGroup'], >

Re: Updating multiple Postgres schema objects from single SQL Alchemy model

2014-01-15 Thread Michael Bayer
. > > On Tuesday, January 14, 2014 11:22:36 PM UTC+1, Michael Bayer wrote: > > On Jan 14, 2014, at 4:56 PM, Dimitris Theodorou > wrote: > >> Tried your approach but I can't get past the inspector wall. >> >> I set the search_path using con

Re: Updating multiple Postgres schema objects from single SQL Alchemy model

2014-01-14 Thread Michael Bayer
). sorry for the reversal here, if i were just trying it out I’d probably settle on something sooner. > > On Tuesday, January 14, 2014 5:40:22 PM UTC+1, Michael Bayer wrote: > this is a hard problem, but my notion is that since you are setting up the > “schema” by manipulating sea

Re: Updating multiple Postgres schema objects from single SQL Alchemy model

2014-01-14 Thread Michael Bayer
this is a hard problem, but my notion is that since you are setting up the “schema” by manipulating search_path, you should be making sure this is set to what it needs to be before autogenerate runs. if you want to autogenerate for three schemas, you’d modify your env.py to run “context.run_mig

Re: [sqlalchemy] SQLAlchemy 0.9.1 released

2014-01-06 Thread Michael Bayer
Just an update, read the docs has been having problems building, the current changelog for 0.9.1 can be viewed at: http://docs.sqlalchemy.org/en/latest/changelog/changelog_09.html#change-0.9.1 On Jan 5, 2014, at 7:54 PM, Michael Bayer wrote: > Hello again list! > > SQLAlchemy rele

SQLAlchemy 0.9.1 released

2014-01-05 Thread Michael Bayer
Hello again list! SQLAlchemy release 0.9.1 is now available. This release is primarily a quick-hit regression release; as we moved fast through 0.9 betas only releasing a single beta, a couple of small regressions popped up since then; this release fixes those. The release does however include

SQLAlchemy 0.9.0 Released

2013-12-30 Thread Michael Bayer
Hey list - SQLAlchemy release 0.9.0 is now available. After about a year's worth of development, 0.9.0 is the first official release of the 0.9 series of SQLAlchemy. As always, 0.9 includes many major architectural improvements and new features. To get an overview of SQLAlchemy 0.9's new featu

Re: NotImplementedError: No generic 'DROP CONSTRAINT' in MySQL

2013-12-29 Thread Michael Bayer
MySQL requires a “type” for a drop constraint, so that the directive knows what specific DROP command to emit on MySQL. Other databases don’t have this limitation which is why there’s a “drop_constraint” in the first place, as opposed to “drop_foreign_key”, “drop_check_constraint”, etc. from

Re: 0.6.1 -- automigration not detecting new table

2013-12-29 Thread Michael Bayer
On Dec 29, 2013, at 2:25 PM, Michael wrote: > I have a models dir which contains a new .py which contains: > > > Alembic doesn't appear to detect the new Logging table despite it importing > the bar.models __init__.py for Base and the env.py importing the same file > and containing `target_m

alembic 0.6.2 released

2013-12-27 Thread Michael Bayer
hey list - Pushed out Alembic 0.6.2. The big deal in this one is more changes/rework of the new index/unique constraint autogenerate feature. Turns out that MySQL has all kinds of left turns as well, not just Postgresql, creating indexes and unique constraints implicitly for each other and

  1   2   >