Skip to content

Commit

Permalink
quash warnings from MySQL
Browse files Browse the repository at this point in the history
Fixes #2046.
  • Loading branch information
djmitche committed Aug 1, 2011
1 parent 160542b commit 134c633
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions master/buildbot/db/migrate/versions/009_add_patch_author.py
Expand Up @@ -21,9 +21,16 @@ def upgrade(migrate_engine):

# add patch_author and patch_comment to the patches table

# mysql doesn't like default values on these columns
defaults = {}
if migrate_engine.dialect.name != "mysql":
defaults['server_default'] = sa.DefaultClause('')

patches = sa.Table('patches', metadata, autoload=True)
patch_author= sa.Column('patch_author', sa.Text, server_default=sa.DefaultClause(''), nullable=False)
patch_author= sa.Column('patch_author', sa.Text, nullable=False,
**defaults)
patch_author.create(patches, populate_default=True)

patch_author= sa.Column('patch_comment', sa.Text, server_default=sa.DefaultClause(''), nullable=False)
patch_author= sa.Column('patch_comment', sa.Text, nullable=False,
**defaults)
patch_author.create(patches, populate_default=True)

0 comments on commit 134c633

Please sign in to comment.