diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-08-24 13:55:14 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-08-24 13:58:32 -0400 |
| commit | 58617ff5ff2facafdc6d17f7115a338daf878629 (patch) | |
| tree | 63cd884d10ab092f7cf8153168325de9333a1f9e /lib/sqlalchemy/sql | |
| parent | f8061236b8e74596fcb372149b76b9caa476e5b5 (diff) | |
| download | sqlalchemy-58617ff5ff2facafdc6d17f7115a338daf878629.tar.gz | |
- The :class:`.CreateColumn` construct can be appled to a custom
compilation rule which allows skipping of columns, by producing
a rule that returns ``None``. Also in 0.8.3.
Conflicts:
doc/build/changelog/changelog_09.rst
lib/sqlalchemy/sql/ddl.py
Diffstat (limited to 'lib/sqlalchemy/sql')
| -rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 01959ee18..fcd137fbd 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -1929,11 +1929,13 @@ class DDLCompiler(engine.Compiled): for create_column in create.columns: column = create_column.element try: - text += separator - separator = ", \n" - text += "\t" + self.process(create_column, + processed = self.process(create_column, first_pk=column.primary_key and not first_pk) + if processed is not None: + text += separator + separator = ", \n" + text += "\t" + processed if column.primary_key: first_pk = True except exc.CompileError, ce: |
