Mike Bayer [Sun, 14 Apr 2013 22:47:09 +0000 (18:47 -0400)]
- rework the -r flag on history to make use of existing walk_revisions();
this way we get at relative revisions, error handling, etc.
- don't run environment for history command unless "current" was requested;
running the environment modifies output with logging, might access multiple
dbs, etc., so don't get into it if not needed
- add test suite for commands, start with history output
- document/changelog for history -r feature
- fix sys.stdout writing for py3k
- one more with_statement future not needed
Mike Bayer [Sat, 13 Apr 2013 00:10:56 +0000 (20:10 -0400)]
- will call this 0.6
- cleanup unused symbols in compat
- move any remaining conditional import switches out to compat
- pretty sure anything we use for a buffer will have flush()
- I can see that using the new io.* stuff means codecs isn't too
smooth here, but removed the double-wrap check in migration.py
which seems to be due to the bytesio setup in the test suite, simplified
this so that an encoding-writing test just writes to BytesIO
- removed all "from __future__ import with_statement"
- i think when we load_source(), that file might not be ascii
so we need to open as bytes
- make encoding an explcit argument in test suite write_script()
- sort the columns in autogenerate so that the autogen tests run
consistently on python3.3, seems to have a very random set ordering,
also loosen up an ordered check in test_op
Hong Minhee [Wed, 10 Apr 2013 20:34:07 +0000 (05:34 +0900)]
Use relative imports
This change does not affect to any behaviors of it, but is just stylish
improvements to remove 2to3 dependency.
1. All old-style absolute imports e.g. `from alembic import util` are
replaced by relative imports e.g. `from . import util`.
2. Use of proxy modules (`alembic.op` and `alembic.context`) are replaced
by deferred import patterns, but these modules still exist.
3. Imports are grouped by 3 types of their origins (standard libraries,
third party libraries, and local modules) and blank lines are put between
each group of imports. This style is from PEP 8:
For stylish change, I can't do that much, because it was intentionally done
as it was by the author. If the author will allow me to make it more closer
to PEP 8 style, I will do that as well.
Mike Bayer [Thu, 4 Apr 2013 19:19:36 +0000 (15:19 -0400)]
- typo
- changelog: Added --head-only option to "alembic current",
will print current version plus the symbol
"(head)" if this version is the head or not.
Courtesy Charles-Axel Dein.
Mike Bayer [Mon, 4 Mar 2013 23:56:50 +0000 (18:56 -0500)]
- The rendering of any construct during autogenerate
can be customized, in particular to allow special rendering
for user-defined column, constraint subclasses, using new
``render_item`` argument to
:meth:`.EnvironmentContext.configure`.
#108
Mike Bayer [Sat, 16 Feb 2013 01:20:50 +0000 (20:20 -0500)]
Fixed bug whereby create_index()
would include in the constraint columns that
are added to all Table objects using events,
externally to the generation of the constraint.
This is the same issue that was fixed for unique
constraints in version 0.3.2.
Mike Bayer [Mon, 11 Feb 2013 22:19:42 +0000 (17:19 -0500)]
- repair argspec to work with py3k also
- relying upon SQLA argspec compat here, so let's also bump compatibility
to 0.7.3, as 0.6 is working poorly in any case
Mike Bayer [Mon, 11 Feb 2013 19:37:59 +0000 (14:37 -0500)]
- move to 0.5.0 as we are making some slight naming changes
- add a generalized approach for renamed kw args, accepting the old
ones using a specialized decorator
- change "tablename" to "table_name" for create_index, drop_index,
drop_constraint
- change "name" to "new_column_name" for alter_column
#104
Mike Bayer [Thu, 10 Jan 2013 21:20:57 +0000 (16:20 -0500)]
The "implicit" constraint generated by a
type such as Boolean or Enum will not generate an
ALTER statement when run on SQlite, which does not
support ALTER for the purpose of adding/removing
constraints separate from the column def itself.
While SQLite supports adding a CHECK constraint
at the column level, SQLAlchemy would need modification
to support this.
A warning is emitted indicating this
constraint cannot be added in this scenario.
#98
Mike Bayer [Sat, 5 Jan 2013 17:13:28 +0000 (12:13 -0500)]
- add workaround to setup.py to avoid setuptools issue regarding multiprocessing
when "setup.py test" is run, #96
- add version detection for 0.8, apply this version detection to
test_autogenerate:AutogenRenderTest.test_render_fk_constraint_kwarg
and emit explicit append_constraint() for each FK if not on 0.8 as FKs
do not auto-attach in 0.7, #96
- add a README containing instructions for running tests and setting up
optional database backens, #96
Mike Bayer [Wed, 5 Dec 2012 18:54:25 +0000 (13:54 -0500)]
Autogenerate will include "autoincrement=False"
in the rendered table metadata
if this flag was set to false on the source
:class:`.Column` object.
#94
Christian Blume [Fri, 5 Oct 2012 09:10:06 +0000 (11:10 +0200)]
- added option 'version_table_schema' to version_table in __init__ of MigrationContext -> makes it possible to use 'version_table_schema' option in context.configure() of env.py
Mike Bayer [Sun, 30 Sep 2012 18:57:11 +0000 (14:57 -0400)]
- [feature] Support for tables in alternate schemas
has been added fully to all operations, as well as to
the autogenerate feature. When using autogenerate,
specifying the flag include_schemas=True to
Environment.configure() will also cause autogenerate
to scan all schemas located by Inspector.get_schema_names(),
which is supported by *some* (but not all)
SQLAlchemy dialects including Postgresql.
*Enormous* thanks to Bruno Binet for a huge effort
in implementing as well as writing tests. #33.
Mike Bayer [Sun, 30 Sep 2012 17:09:30 +0000 (13:09 -0400)]
- [feature] Added "stdout" option to Config, provides
control over where the "print" output of commands like
"history", "init", "current" etc. are sent. #43
Mike Bayer [Sun, 30 Sep 2012 16:57:29 +0000 (12:57 -0400)]
- [bug] Fixed the "multidb" template which was badly out
of date. It now generates revision files using
the configuration to determine the different
upgrade_<xyz>() methods needed as well, instead of
needing to hardcode these. Huge thanks to
BryceLohr for doing the heavy lifting here. #71
Mike Bayer [Sun, 30 Sep 2012 16:37:02 +0000 (12:37 -0400)]
- [bug] Fixed the regexp that was checking for .py files
in the version directory to allow any .py file through.
Previously it was doing some kind of defensive checking,
probably from some early notions of how this directory
works, that was prohibiting various filename patterns
such as those which begin with numbers. #72
Mike Bayer [Sun, 30 Sep 2012 16:24:43 +0000 (12:24 -0400)]
- call it 0.4.0
- [feature] The command line runner has been organized
into a reusable CommandLine object, so that other
front-ends can re-use the argument parsing built
in. #70