Mike Bayer [Fri, 23 Aug 2013 17:25:31 +0000 (13:25 -0400)]
- Ensured that strings going to stdout go through an encode/decode phase,
so that any non-ASCII characters get to the output stream correctly
in both Py2k and Py3k. Also added source encoding detection using
Mako's parse_encoding() routine in Py2k so that the __doc__ of a
non-ascii revision file can be treated as unicode in Py2k.
Mike Bayer [Thu, 11 Jul 2013 23:07:14 +0000 (19:07 -0400)]
Added new kw argument to :meth:`.EnvironmentContext.configure`
``include_object``. This is a more flexible version of the
``include_symbol`` argument which allows filtering of columns as well as tables
from the autogenerate process,
and in the future will also work for types, constraints and
other constructs. The fully constructed schema object is passed,
including its name and type as well as a flag indicating if the object
is from the local application metadata or is reflected.
Mike Bayer [Wed, 26 Jun 2013 21:08:32 +0000 (17:08 -0400)]
The output of the ``alembic history`` command is now
expanded to show information about each change on multiple
lines, including the full top message,
resembling the formatting of git log.
Mike Bayer [Sun, 2 Jun 2013 05:45:20 +0000 (01:45 -0400)]
- Added :attr:`alembic.config.Config.cmd_opts` attribute,
allows access to the `argparse` options passed to the
`alembic` runner.
- Added new command line argument ``-x``, allows extra arguments
to be appended to the command line which can be consumed
within an ``env.py`` script by looking at
``context.config.cmd_opts.x``.
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