Mike Bayer [Wed, 11 Dec 2013 22:00:06 +0000 (17:00 -0500)]
- Fixed an issue with unique constraint autogenerate detection where
a named ``UniqueConstraint`` on both sides with column changes would
render with the "add" operation before the "drop", requiring the
user to reverse the order manually.
- reorganize the index/unique autogenerate test into individual test cases;
ideally the whole test suite would be broken out like this for those big
tests
Mike Bayer [Sat, 7 Dec 2013 00:05:53 +0000 (19:05 -0500)]
- Added new argument ``mssql_drop_foreign_key`` to
:meth:`.Operations.drop_column`. Like ``mssql_drop_default``
and ``mssql_drop_check``, will do an inline lookup for a
single foreign key which applies to this column, and drop it.
For a column with more than one FK, you'd still need to explicitly
use :meth:`.Operations.drop_constraint` given the name,
even though only MSSQL has this limitation in the first place.
Mike Bayer [Wed, 27 Nov 2013 00:05:03 +0000 (19:05 -0500)]
- rework mysql tests to have suites
- add a test to verify pullreq #5 - check if a TIMESTAMP column with
CURRENT_TIMESTAMP as default successfully compares for equality/inequality.
test passes without the pullreq, so no failure case has been demonstrated.
Mike Bayer [Thu, 21 Nov 2013 23:46:35 +0000 (18:46 -0500)]
Fixes to Py3k in-place compatibity regarding output encoding and related;
the use of the new io.* package introduced some incompatibilities on Py2k.
These should be resolved, due to the introduction of new adapter types
for translating from io.* to Py2k file types, StringIO types.
Thanks to Javier Santacruz for help with this.
Mike Bayer [Thu, 21 Nov 2013 22:47:24 +0000 (17:47 -0500)]
Fixed the output wrapping for Alembic message output, so that
we either get the terminal width for "pretty printing" with
indentation, or if not we just output the text as is; in any
case the text won't be wrapped too short. #135
Javier Santacruz [Thu, 17 Oct 2013 15:24:28 +0000 (17:24 +0200)]
Fixes stdout --sql output in python2
When output_encoding is set, wraps the output buffer into a io.TextIOWrapper class
This means that the output_buffer has to be a io.IOBase instance
in order to work along with the TextIOWrapper
Handles wrapping when the buffer is Python2 stdtout, which has 'file' type
Adds test for this situation
Mike Bayer [Fri, 11 Oct 2013 21:14:28 +0000 (17:14 -0400)]
- fix the change we did in 56a178d2181c84ab8bf2edbe6fdf8439f4 so that the unique constraint/index thing
on PG still works
- replicate the index test for PG
Mike Bayer [Sun, 8 Sep 2013 21:04:17 +0000 (17:04 -0400)]
- refactor autogeneration into its own package
- remove any implicit naming of unique constraints - only explcitly named constraints
are supported by autogenerate
- ensure we correctly handle the case where unique reflection raises not implemented
- fix some naming conventions, changes to expressions for readability
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