Commit Graph

773 Commits

Author SHA1 Message Date
Mike Bayer ceeac2a455 - build out custom autogenerate compare hooks
- new documentation for autogenerate customization
2015-07-16 19:00:14 -04:00
Mike Bayer 1e2848d674 - fully move all autogen to use AutogenContext 2015-07-15 18:46:32 -04:00
Mike Bayer fd713802b5 Merge branch 'master' into ticket_306 2015-07-15 16:02:04 -04:00
Mike Bayer c194791062 - some additional names
- warn for name changes
2015-07-14 18:41:46 -04:00
Mike Bayer 4fd0276118 - handle missing arg more clearly
- add missing translate for create_pk
2015-07-14 13:25:18 -04:00
Mike Bayer 6f8d0f2e2d - move the "legacy names" system into where we create the module proxy.
This is so that we can do a total open ended "*args, **kw" style translation
for the vast majority of use cases that are using alembic.op, without impacting
docstrings for the Operations class.
There is a risk here of impacting an application that is using Operations
directly instantitaed while using old names.   We may still have to accommodate
that somehow.
2015-07-14 12:42:19 -04:00
Mike Bayer e0fd18b33a - factor out autogen_context as a dictionary within the tests, localize
to the fixtures module where we can fix it in one place
2015-07-12 15:43:47 -04:00
Mike Bayer 5c31c546b5 - propose an AutogenContext object but the task of fixing it within
all the tests has to be worked out
2015-07-07 17:28:47 -04:00
Mike Bayer aa35022ca7 - have the operations related to createtable still be within a
modify table block
2015-07-07 16:17:03 -04:00
Mike Bayer 6d797a8138 - api.py is tiny now, don't need separate generate.py module 2015-07-06 21:24:31 -04:00
Mike Bayer 012d4e3844 - all tests passing again. next step is do the compare API 2015-07-06 21:20:55 -04:00
Mike Bayer 9eb8f3a085 get all of autogen_diffs tests to pass again 2015-07-06 20:42:17 -04:00
Mike Bayer ea5ca8980c working thru tests... 2015-07-06 18:19:31 -04:00
Mike Bayer 8ecaabf64c - most reverse() methods rough draft
- replace most use of diffs in compare
2015-07-06 16:50:33 -04:00
Mike Bayer a294f8cc3f - Implemented support for :meth:`.BatchOperations.create_primary_key`
and :meth:`.BatchOperations.create_check_constraint`.
fixes #305
- table keyword arguments are copied from the original reflected table,
such as the "mysql_engine" keyword argument.
2015-07-03 17:37:44 -04:00
Mike Bayer ad5390c0e3 Index didn't have a quote parameter until 0.9, when the quote param is
portable to the name itself.  so we don't need to handle this arg
explicitly.
2015-07-03 16:10:41 -04:00
Mike Bayer 2730ecd97c - try to explain this better 2015-07-03 13:34:15 -04:00
Mike Bayer 37ec812056 - add the .info dictionary, references #302 2015-07-03 13:15:03 -04:00
Mike Bayer 0e43247da4 - squash merge of ticket_302 branch
- The internal system for Alembic operations has been reworked to now
build upon an extensible system of operation objects.  New operations
can be added to the ``op.`` namespace, including that they are
available in custom autogenerate schemes.  fixes #302
- The internal system for autogenerate been reworked to build upon
the extensible system of operation objects present in #302.
A new customization hook process_revision_directives is added
to allow manipulation of the autogen stream.  Fixes #301
2015-07-03 13:10:41 -04:00
Mike Bayer 5ccc81701c - add a changelog for the legacy_schema_aliasing warning issue,
the fix was committed in 229f8672.
2015-06-26 18:09:50 -04:00
Mike Bayer a3f181a7a0 - add clarification that this tutorial is against the generic template 2015-06-17 14:54:34 -04:00
Mike Bayer 541cbd26b5 - The :meth:`.MigrationContext.stamp` method, added as part of the
versioning refactor in 0.7 as a more granular version of
:func:`.command.stamp`, now includes the "create the alembic_version
table if not present" step in the same way as the command version,
which was previously omitted.
fixes #300
2015-06-09 11:40:34 -04:00
Mike Bayer 229f86723b - turn on the mssql legacy_schema_aliasing flag to remove
warnings
2015-05-26 10:55:36 -04:00
Mike Bayer 29b301a7ec - Fixed bug where foreign key options including "onupdate",
"ondelete" would not render within the ``op.create_foreign_key()``
directive, even though they render within a full
``ForeignKeyConstraint`` directive.
fixes #298
2015-05-18 20:21:49 -04:00
Mike Bayer 87629c53ac - add test for FKC with multiple kwargs, reference #92 2015-05-18 19:48:09 -04:00
Mike Bayer 6ae4196acc 0.7.6 2015-05-05 17:02:26 -04:00
Mike Bayer 0ea37679dd Merged in jdanjou/alembic/jd/typo-doc-comparator (pull request #44)
Fix typo in autogenerate documentation
2015-05-04 12:57:13 -04:00
Julien Danjou 239cf80306 Fix typo in autogenerate documentation 2015-05-04 17:57:42 +02:00
Mike Bayer c75be37640 - Fixed bug where the case of multiple mergepoints that all
have the identical set of ancestor revisions would fail to be
upgradable, producing an assertion failure.   Merge points were
previously assumed to always require at least an UPDATE in
alembic_revision from one of the previous revs to the new one,
however in this case, if one of the mergepoints has already
been reached, the remaining mergepoints have no row to UPDATE therefore
they must do an INSERT of their target version.
fixes #297
2015-05-03 20:17:19 -04:00
Mike Bayer b35dbff602 - add tox targets for 3.4 2015-05-01 14:54:44 -04:00
Mike Bayer dabc7f0932 - Added support for type comparison functions to be not just per
environment, but also present on the custom types themselves, by
supplying a method ``compare_against_backend``.
Added a new documentation section :ref:`compare_types` describing
type comparison fully.
fixes #296
2015-04-30 11:33:58 -04:00
Mike Bayer a192c345fc Merged in rtaranu/alembic (pull request #43)
- fixed spelling mistake in docs
2015-04-21 13:04:50 -04:00
Raul Taranu 7f21db8618 - fixed spelling mistake in docs 2015-04-21 13:22:40 +00:00
Mike Bayer 0e1c098989 - Added a new option
:paramref:`.EnvironmentContext.configure.literal_binds`, which
will pass the ``literal_binds`` flag into the compilation of SQL
constructs when using "offline" mode.  This has the effect that
SQL objects like inserts, updates, deletes as well as textual
statements sent using ``text()`` will be compiled such that the dialect
will attempt to render literal values "inline" automatically.
Only a subset of types is typically supported; the
:meth:`.Operations.inline_literal` construct remains as the construct
used to force a specific literal representation of a value.
The :paramref:`.EnvironmentContext.configure.literal_binds` flag
is added to the "offline" section of the ``env.py`` files generated
in new environments.
fixes #255
- enhance the op_fixture as well as MigrationContext._stdout_connection()
 so that it uses the real DefaultImpl
and MigrationContext fully in tests.
2015-04-07 12:41:46 -04:00
Mike Bayer 54e4f58d1f - repair name of starting_rev argument, fixes #290 2015-03-29 09:33:27 -04:00
Mike Bayer 73650a8f19 - dont rely on inpsect import, not in SQLA 0.7 2015-03-28 12:51:45 -04:00
Mike Bayer d5198d0d2b - don't use op.f(), only works with later SQLA versions 2015-03-28 11:56:08 -04:00
Mike Bayer f02f211b93 - Fully implemented the
:paramref:`~.Operations.batch_alter_table.copy_from` parameter for
batch mode, which previously was not functioning.  This allows
"batch mode" to be usable in conjunction with ``--sql``.
fixes #289
- sqlite dialect checks for "create_index" and "drop_index" as exceptions
for "recreate" in batch mode, the same way as "add_column", so that
unnecessary table recreates don't emit for index-only operations
2015-03-27 18:55:00 -04:00
Mike Bayer 9545e87008 - next version 2015-03-27 18:52:20 -04:00
Mike Bayer 2af6e438c9 - Repaired support for the :meth:`.BatchOperations.create_index`
directive, which was mis-named internally such that the operation
within a batch context could not proceed.
fixes #287
2015-03-27 15:15:55 -04:00
Mike Bayer c3e39ec4bf - didn't name the internal number correctly, stil
don't have this right.  up to post2
2015-03-20 15:29:39 -04:00
Mike Bayer e1dc713aa6 - 0.7.5.post1 due to pypi deletion issue 2015-03-20 15:20:10 -04:00
Mike Bayer 5d036bc203 0.7.5 2015-03-19 16:34:56 -04:00
Mike Bayer 4c2f825086 - changelog for #266
- use exception fixture
- look directly at context.as_sql as that's where
the "sql mode" is most authoritative
- fixes #266
2015-03-19 15:51:11 -04:00
Mike Bayer 3b516aecde Merge branch 'issue266' of https://bitbucket.org/jerdfelt/alembic into pr39 2015-03-19 15:40:38 -04:00
Mike Bayer 6235698863 - Fixed bug where the mssql DROP COLUMN directive failed to include
modifiers such as "schema" when emitting the DDL.
fixes #284
2015-03-11 11:34:40 -04:00
Mike Bayer 77a6c827bf - an adjustment to the logic for #282 - if the index we see here
*is* in conn_indexes_by_name, then obviously we should leave it in.
2015-03-10 16:14:21 -04:00
Mike Bayer 46761f9d86 - Postgresql "functional" indexes are necessarily skipped from the
autogenerate process, as the SQLAlchemy backend currently does not
support reflection of these structures.   A warning is emitted
both from the SQLAlchemy backend as well as from the Alembic
backend for Postgresql when such an index is detected.
fixes #282
2015-03-10 11:26:43 -04:00
Mike Bayer 6443b29042 - add support for assertion of warnings emitted 2015-03-10 11:26:21 -04:00
Mike Bayer 826e5cfab5 - make the repo dynamic 2015-03-10 11:26:07 -04:00