Commit Graph

622 Commits

Author SHA1 Message Date
Mike Bayer 713b128df4 - changelog
fixes #21
2014-11-09 16:27:11 -05:00
Mike Bayer 36fa6e4603 - test fixup
- get batch mode to fail gracefully, dropping the temp table if
the operation fails
- finish tutorial
2014-11-09 16:16:09 -05:00
Mike Bayer a9c58f1ca6 - add a type here so that to account for pre-0.9 FK/type support 2014-11-09 12:40:35 -05:00
Mike Bayer 8e8a6bb71a Merge branch 'master' into batch_alter 2014-11-09 12:38:40 -05:00
Mike Bayer 513bf2c2ba - adjust these to account for some MySQL deprecations regarding
duplicate indexes against the same columns
2014-11-09 12:38:16 -05:00
Mike Bayer 9abd572c70 - add some connection cleanup 2014-11-09 12:33:26 -05:00
Mike Bayer 8b8fe7b3c3 - more docs 2014-11-08 23:20:10 -05:00
Mike Bayer 8ab32c426e documenting 2014-11-08 22:55:51 -05:00
Mike Bayer 7d595940d4 - add a little step to get PG to work rudimentally, however
the drop + recreate routine still needs a solution for refernential
integrity for it to be of general use
2014-11-08 22:42:07 -05:00
Mike Bayer 133ff1d16b - start docs
- run tests against mysql/PG to make sure auto mode works at least, try
a proof of concept recreate for MySQL.  recreate doesn't work on PG
as constraint names are global (ugh).  Will have to figure something
out on that.
2014-11-08 18:59:28 -05:00
Mike Bayer 7229035943 - round trip tests
- fixes to add column
2014-11-08 18:44:43 -05:00
Mike Bayer ed305c6347 Merge branch 'master' into batch_alter 2014-11-08 18:06:47 -05:00
Mike Bayer 8272c85faa - The :class:`~sqlalchemy.schema.Table` object is now returned when
the :meth:`.Operations.create_table` method is used.  This ``Table``
is suitable for use in subsequent SQL operations, in particular
the :meth:`.Operations.bulk_insert` operation.
fixes #205
2014-11-08 18:06:26 -05:00
Mike Bayer be274ae288 - finish up most features 2014-11-08 17:51:34 -05:00
Mike Bayer e2c46aa37a move this 2014-11-08 11:24:47 -05:00
Mike Bayer daf1dfe1a2 - testing approaches for BatchOperationsImpl and ApplyBatchImpl 2014-11-08 11:22:34 -05:00
Mike Bayer 7eee8033c2 proof of concept 2014-11-07 18:45:33 -05:00
Mike Bayer b5ce0c4db2 docstring 2014-11-07 17:20:33 -05:00
Mike Bayer 644317e2fe - add tests for batch autogenerate 2014-11-07 17:06:38 -05:00
Mike Bayer 0933f08dc5 - add support for autogenerate to include "batch" 2014-11-06 19:37:49 -05:00
Mike Bayer 94024c2d2d - use pyprinter for autogen so that we get indentation logic 2014-11-06 18:49:24 -05:00
Mike Bayer 9a5211e79f Merge branch 'master' into batch_alter 2014-11-06 18:29:34 -05:00
Mike Bayer 5112dc1433 - skip unique constraint tests on 0.7 2014-11-05 11:17:23 -05:00
Mike Bayer e7d17fb89b - Indexes and unique constraints are now included in the
:paramref:`.EnvironmentContext.configure.include_object` hook.
Indexes are sent with type ``"index"`` and unique constraints with
type ``"unique_constraint"``.
fixes #203
2014-11-02 18:33:51 -05:00
Mike Bayer 0fa7716ffe - Bound parameters are now resolved as "literal" values within the
SQL expression inside of a CheckConstraint(), when rendering the SQL
as a text string; supported for SQLAlchemy 0.8.0 and forward.
fixes #219
2014-11-02 12:46:20 -05:00
Mike Bayer 92184a55ca - Added a workaround for SQLAlchemy issue #3023 (fixed in 0.9.5) where
a column that's part of an explicit PrimaryKeyConstraint would not
have its "nullable" flag set to False, thus producing a false
autogenerate.  Also added a related correction to MySQL which will
correct for MySQL's implicit server default of '0' when a NULL integer
column is turned into a primary key column. fixes #199
2014-11-02 12:35:47 -05:00
Mike Bayer b16bdf8789 - Repaired issue related to the fix for #208 and others; a composite
foreign key reported by MySQL would cause a KeyError as Alembic
attempted to remove MySQL's implicitly generated indexes from the
autogenerate list.
fixes #240
2014-11-02 10:34:58 -05:00
Mike Bayer 9650ccfb68 - If the "alembic_version" table is present in the target metadata,
autogenerate will skip this also.  Pull request courtesy
Dj Gilcrease. fixes #28
- The :paramref:`.EnvironmentContext.configure.version_table`
and :paramref:`.EnvironmentContext.configure.version_table_schema`
arguments are now honored during the autogenerate process, such that
these names will be used as the "skip" names on both the database
reflection and target metadata sides. fixes #77
2014-10-29 21:02:29 -04:00
Mike Bayer c2a91ac4d2 - sketch of how "batch operations" would work 2014-10-22 19:12:17 -04:00
Mike Bayer 44d5eea91b - the original rationale for defaulting the user-defined namespace
to "sa." was to force users to deal with making sure their custom
types came from a fixed module somewhere.  However, it's not worth
defending this rationale.

The default value of the
:paramref:`.EnvironmentContext.configure.user_module_prefix`
parameter is **no longer the same as the SQLAlchemy prefix**.
When omitted, user-defined types will now use the ``__module__``
attribute of the type class itself when rendering in an
autogenerated module.

fixes #229
2014-10-21 13:14:06 -04:00
Mike Bayer fd2a172df6 - amending d81619b50b9df7ff4458:
Revision files are now written out using the ``'wb'`` modifier to
``open()``, since Mako reads the templates with ``'rb'``, thus preventing
CRs from being doubled up as has been observed on windows.  The encoding
of the output now defaults to 'utf-8', which can be configured using
a newly added config file parameter ``output_encoding``.
fixes #234
2014-10-20 14:24:41 -04:00
Mike Bayer d81619b50b - Revision files are now written out using the ``'wb'`` modifier to
``open()``, since Mako reads the templates with ``'rb'``, thus preventing
CRs from being doubled up as has been observed on windows.
fixes #234
2014-10-20 13:02:32 -04:00
Mike Bayer ac95bad85c - fail this before 0.9 2014-10-11 17:30:44 -04:00
Mike Bayer 091afc0b0f Merged in ltvolks/alembic/docs-153 (pull request #28)
Update documentation for create_index parameters
2014-10-10 15:25:15 -04:00
Mike Bayer a7bbc7db29 - add tests for unique and quote flag on create_index() 2014-10-10 14:23:05 -05:00
Lucas Taylor 52e84dde00 Update documentation for create_index parameters 2014-10-10 14:23:05 -05:00
Mike Bayer b98df9bf13 - add tests for unique and quote flag on create_index() 2014-10-10 14:05:09 -04:00
Mike Bayer 5bb97a4b09 - Added support for use of the :class:`~sqlalchemy.sql.elements.quoted_name`
construct when using the ``schema`` argument within operations.  This
allows a name containing a dot to be fully quoted, as well as to
provide configurable quoting on a per-name basis.
fixes #230
2014-10-03 11:12:19 -04:00
Mike Bayer 49b41feef2 - add changelog for bugfix re: match + SQLA 0.7 2014-09-22 14:36:44 -04:00
Mike Bayer 85e7308b86 inspect 2014-09-20 19:13:58 -04:00
Mike Bayer 3f1ba114d6 - compat for sqla 0.7 2014-09-20 18:33:00 -04:00
Mike Bayer e31274e328 add missing util lib 2014-09-20 18:16:17 -04:00
Mike Bayer 0767aa78be - fix this to be a definite non native boolean dialect 2014-09-20 17:25:16 -04:00
Mike Bayer ff74edfc7e - Added a routine by which the Postgresql Alembic dialect inspects
the server default of INTEGER/BIGINT columns as they are reflected
during autogenerate for the pattern ``nextval(<name>...)`` containing
a potential sequence name, then queries ``pg_catalog`` to see if this
sequence is "owned" by the column being reflected; if so, it assumes
this is a SERIAL or BIGSERIAL column and the server default is
omitted from the column reflection as well as any kind of
server_default comparison or rendering, along with an INFO message
in the logs indicating this has taken place. This allows SERIAL/BIGSERIAL
columns to keep the SEQUENCE from being unnecessarily present within
the autogenerate operation.
fixes #73
2014-09-20 17:23:00 -04:00
Mike Bayer 75652fe132 - changelog for #197, fixes #197. 2014-09-20 15:06:05 -04:00
Mike Bayer 03b9803e4e - get tests passing for 0.8, 0.7 2014-09-20 14:54:37 -04:00
Mike Bayer fb5573bd11 - move tests erroneously local to the "named" tests
- add tests for CAST within index
2014-09-20 14:45:10 -04:00
Mike Bayer 2b3965b917 - more tweaks for server defaults re: comparison, test results
- in particular we've changed the server_default for order.amount
to text('0'); SQlite and Postgresql now both report the server
default as '0', whereas previously, when we were emitting '0'
with the quotes in the CREATE TABLE, SQlite reported it as
"'0'" and PG as '0::numeric'.
2014-09-20 14:37:01 -04:00
Mike Bayer cbbd550ea6 pep8 2014-09-20 13:56:13 -04:00
Mike Bayer eea8dfcfc2 - restore _render_server_default_for_compare() to compare.py using
the method previously used in _render_server_default() in render;
these two functions become more specific to compare vs. render now
so are separated out
2014-09-20 13:53:11 -04:00