Mike Bayer [Sat, 27 Apr 2019 00:22:21 +0000 (20:22 -0400)]
Check for rendered integer default is None on MySQL
Fixed bug when using the
:paramref:`.EnvironmentContext.configure.compare_server_default` flag set
to ``True``where a server default that is introduced in the table metadata
on an ``Integer`` column, where there is no existing server default in the
database, would raise a ``TypeError``.
Mike Bayer [Wed, 24 Apr 2019 18:46:03 +0000 (13:46 -0500)]
Raise for non-string revision identifier
Added an assertion in :meth:`.RevisionMap.get_revisions` and other methods
which ensures revision numbers are passed as strings or collections of
strings. Driver issues particularly on MySQL may inadvertently be passing
bytes here which leads to failures later on.
Mike Bayer [Tue, 23 Apr 2019 17:21:09 +0000 (12:21 -0500)]
Use first line of command docstring for help text.
Fixed bug introduced in release 1.0.9 where the helptext for commands
inadvertently got expanded to include function docstrings from the
command.py module. The logic has been adjusted to only refer to the first
line of each docstring as was the original intent.
Mike Bayer [Fri, 29 Mar 2019 17:46:32 +0000 (13:46 -0400)]
Remove formatargspec work from create_method_proxy
Simplified the internal scheme used to generate the ``alembic.op`` namespace
to no longer attempt to generate full method signatures (e.g. rather than
generic ``*args, **kw``) as this was not working in most cases anyway, while
in rare circumstances it would in fact sporadically have access to the real
argument names and then fail when generating the function due to missing
symbols in the argument signature.
Mike Bayer [Mon, 4 Mar 2019 14:37:08 +0000 (09:37 -0500)]
Clarify and correct PostgreSQL server default comparison for py37
Fixed issue where server default comparison on the PostgreSQL dialect would
fail for a blank string on Python 3.7 only, due to a change in regular
expression behavior in Python 3.7.
Parth Shandilya [Mon, 4 Feb 2019 19:26:48 +0000 (14:26 -0500)]
Removed force parameter from base.py
Removed use of deprecated ``force`` parameter for SQLAlchemy quoting
functions as this parameter will be removed in a future release.
Pull request courtesy Parth Shandilya(ParthS007).
Mike Bayer [Thu, 7 Feb 2019 15:04:41 +0000 (10:04 -0500)]
Repair tests for SQLAlchemy 1.3 safestring change
Latest 1.3 includes checks for valid SQL keywords and applies
column() to the element of ExcludeConstraint, adjust tests to
work for this as well as previous behavior.
Damien Garaud [Wed, 23 Jan 2019 16:13:37 +0000 (11:13 -0500)]
Fix single quote escaping for the SQL comments
Fixed issue in new comment support where autogenerated Python code
for comments wasn't using ``repr()`` thus causing issues with
quoting. Pull request courtesy Damien Garaud.
Mike Bayer [Fri, 11 Jan 2019 20:40:10 +0000 (15:40 -0500)]
Update comment documentation, make sure tests always run
Corrected the links and text in the changelog note as well as
ensured new comment-oriented methods and parameters include a
versionadded token. Added a more specific check so that
any run of the tests will make sure SQLAlchemy issue 4436
is resolved as 1.2.16 resolves it but 1.3.0b1, which currently
comes out for "python setup.py test", does not.
Mike Waites [Fri, 31 Aug 2018 18:56:36 +0000 (19:56 +0100)]
Implemented support for Table and Column Comments
Added Table and Column level comments for supported backends.
`create_table`, `add_column` and `alter_column` now optionally
take `comment="X"` kwarg. Support for autogenerate for Table
and Column objects has also been added
Mike Bayer [Fri, 28 Dec 2018 14:05:27 +0000 (09:05 -0500)]
reword op.execute()
Apparently op.execute() makes use of _exec() which coerces strings
into text() constructs. This is less than ideal, however for now
document the caveat that colons need to be escaped.
Stefan Tjarks [Thu, 22 Nov 2018 03:08:56 +0000 (22:08 -0500)]
Vendor python3 formatargspec, import from collections.abc
Resolved remaining Python 3 deprecation warnings, covering
the use of inspect.formatargspec() with a vendored version
copied from the Python standard library, importing
collections.abc above Python 3.3 when testing against abstract
base classes, fixed one occurrence of log.warn(), as well as a few
invalid escape sequences.
Add DeprecationWarning to the test suite as an error raise
as has been the case within SQLAlchemy for some time now.
Fixes: #507 Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Change-Id: I121121b3d2dd90e6f3c9b16dec2fc80b9699c400
Pull-request: https://bitbucket.org/zzzeek/alembic/pull-requests/85
Mike Bayer [Wed, 14 Nov 2018 18:53:57 +0000 (13:53 -0500)]
Check for mssql_include is None
Fixed regression caused by :ticket:`513`, where the logic to consume
``mssql_include`` was not correctly interpreting the case where the flag
was not present, breaking the ``op.create_index`` directive for SQL Server
as a whole.
Mike Bayer [Wed, 24 Oct 2018 17:44:09 +0000 (13:44 -0400)]
Dont autogenerate "system=True", render flag correctly
The ``system=True`` flag on :class:`.Column`, used primarily in conjunction
with the Postgresql "xmin" column, now renders within the autogenerate
render process, allowing the column to be excluded from DDL. Additionally,
adding a system=True column to a model will produce no autogenerate diff as
this column is implicitly present in the database.
Mike Bayer [Fri, 19 Oct 2018 14:00:50 +0000 (10:00 -0400)]
Add special handling for SQL Server create_index mssql_includes
Fixed issue where usage of the SQL Server ``mssql_include`` option within a
:meth:`.Operations.create_index` would raise a KeyError, as the additional
column(s) need to be added to the table object used by the construct
internally.
Mike Bayer [Wed, 17 Oct 2018 14:14:22 +0000 (10:14 -0400)]
Replace union_update with update
Fixed issue where removed method ``union_update()`` was used when a
customized :class:`.MigrationScript` instance included entries in the
``.imports`` data member, raising an AttributeError.
Mike Bayer [Wed, 17 Oct 2018 14:09:50 +0000 (10:09 -0400)]
Revert "Replace set union_update() references with update()"
This reverts commit 7e3d032cc92af73988f02f281ab354de7fc8e3ab. the
PR was not provided with a test case or bug report and this is actually
an uncovered code bug. will re-submit with a proper bug report
Luis Calderon [Tue, 16 Oct 2018 13:38:54 +0000 (09:38 -0400)]
Replace set union_update() references with update()
The autogenerate api references the `union_update()` method of sets which was removed in Python 2.4. The previous method is actually an alias for the `update()` method.
This PR replaces the api reference with the correct one for Python 2.7
Mike Waites [Fri, 31 Aug 2018 19:42:27 +0000 (19:42 +0000)]
Don't format output twice in writer
Fixed an issue where revision descriptions were essentially
being formatted twice. Any revision description that contained
characters like %, writing output to stdout will fail because
the call to config.print_stdout attempted to format any
additional args passed to the function.
This fix now only applies string formatting if any args are provided
along with the output text.
Mike Bayer [Fri, 31 Aug 2018 20:24:16 +0000 (16:24 -0400)]
Run batch tests per backend
Seeing a new unexpected success in limited scope for mysql,
correlating with addition of mariadb 10.3 to CI. This test
should be producing db-specific successes/failures to track
it more easily
Mike Bayer [Wed, 11 Jul 2018 18:05:02 +0000 (14:05 -0400)]
Remove column from primary key when dropping
Fixed issue in batch where dropping a primary key column, then adding it
back under the same name but without the primary_key flag, would not remove
it from the existing PrimaryKeyConstraint. If a new PrimaryKeyConstraint
is added, it is used as-is, as was the case before.
Hugo [Sat, 9 Jun 2018 14:41:43 +0000 (17:41 +0300)]
Drop Python 2.6 / 3.3 support
For Alembic 1.0, Python 2.6 / 3.3 support is being dropped, allowing a
fixed setup.py to be built as well as universal wheels. Pull request
courtesy Hugo.
elad [Fri, 29 Jun 2018 15:13:43 +0000 (11:13 -0400)]
Render autogenerate=True if present
Fixed issue where "autoincrement=True" would not render for a column that
specified it, since as of SQLAlchemy 1.1 this is no longer the default
value for "autoincrement". Note the behavior only takes effect against the
SQLAlchemy 1.1.0 and higher; for pre-1.1 SQLAlchemy, "autoincrement=True"
does not render as was the case before. Pull request courtesy Elad Almos.
Mike Bayer [Fri, 18 May 2018 14:23:22 +0000 (10:23 -0400)]
Use external impl for type rendering
The render_type() method of DefaultImpl was hardcoded to
only work for SQLAlchemy types. Most of the work here involves
adding a proof of concept suite illustrating an external dialect
fully rendering types and nested types with imports.
Mike Bayer [Fri, 18 May 2018 15:11:49 +0000 (11:11 -0400)]
Implement native boolean check constraint flag in test suite
This is based on
https://github.com/zzzeek/sqlalchemy/commit/d2bacad469c0b07cc707b563e37e835abcf96eb8
which adds further specificity to SQL Server's boolean behaviors,
the test suite here expects a CHECK constraint to be rendered.
The "op.drop_constraint()" directive will now render using ``repr()`` for
the schema name, in the same way that "schema" renders for all the other op
directives. Pull request courtesy Denis Kataev.